An algorithm is a sequence of well-defined steps that defines an abstract solution to a problem. Use this tag when your issue is related to algorithm design.
0
votes
0answers
29 views
What is fastest algorithm or method displaying line images from line scan camera
We have a line scan camera which produces 300 line images per second. We want to display the lines on a image view in the way of FIFO so that the last line of the view displays the most recent line ...
0
votes
0answers
31 views
FFT Implementation not working
I am implementing the Iterative version of FFT from Introduction to Algorithms, Coremen and I am not able to make it work. I did some unit testing on other parts of the entire program and they all ...
1
vote
1answer
30 views
Range update and querying in a 2D matrix
I don't have a scenario, but here goes the problem. This is one is just driving me crazy. There is a nxn boolean matrix initially all elements are 0, n <= 10^6 and given as input.
Next there will ...
0
votes
3answers
68 views
I need an algorithm to look through 3 lists and find unique items
I've been scratching my head for a couple of hours and could use some help...
I have 3 lists of objects. Each list can contain the same objects (but doesn't have to). I want an algorithm to test if ...
-2
votes
1answer
15 views
BFS on weighted undirected G
I am trying to perform BFS on a weighted undirected graph. can anyone give me an algorithm for converting weighted graph to unweighted so that I can use it as input for BFS algorithm. thanks.
0
votes
0answers
33 views
What are 2-SAT application? [closed]
After getting familiar with 2-SAT problem (http://en.wikipedia.org/wiki/2-satisfiability) when taking algorithms course, I started wondering about real life application of it. Any examples?
2
votes
2answers
62 views
How to find the i-th largest number of a set, and order the i largest numbers
From the "Cormen Leiserson Rivest Stein, 3th Edition, Problem 9-1, point C, pag. 224", I have the following assignment:
Given a set (array) A of n numbers, use an order-statistic
algorithm to ...
0
votes
0answers
11 views
Initialization of the population of a genetic algorithm to selected chromosome - R programming, package genealg
I am using R and in particular the package genalg which allows for quick implementing genetic algorithms and search related activities.
I would like initialize the population of the GA to a set of ...
-2
votes
2answers
46 views
Python: Find the shortest distance to get to another index in a list assuming you can go backwards
How would you find the shortest path between letters in a list, assuming you can go backwards and end up on the other side of the list, Pacman Style
letters = ['a', 'd', 'e', 'l', 's']
...
0
votes
2answers
42 views
Delete elements from Vector without using Iterator
Hi I'm trying to delete certain elements from a vector. I have a solution working, but to me it's not elegant or ideal. I'm in MIDP so I don't have access to Iterator class. Any ideas what's the best ...
1
vote
2answers
39 views
Find all combinations of letters, selecting each letter from a different key in a dictionary
Let's say we have this data structure:
class Lock:
def __init__(self):
self.data1 = ['a', 'd', 'e', 'l', 's']
self.data2 = ['s', 'i', 'r', 't', 'n']
self.data3 = ['b', 'o', 'e', 'm', 'k']
...
1
vote
2answers
39 views
Finding if text contains any words in a list. Which is faster and why?
There might be better solutions but the two I first think of are:
1) For each word in the list, check if the text contains that word
2) Store the words in a set. Store words (anything separated by ...
3
votes
1answer
47 views
Mergesort: How does the computational complexity vary when changing the split point?
I have to do an exercise from my algorithm book. Suppose a mergesort is implemented to split an array by α, which is in a range from 0.1 to 0.9.
This is the original method to calculate the split ...
1
vote
0answers
34 views
Algorithm design (with constraints) to reduce bipartite graph to a tree/forest
I had a question regarding designing an algorithm to make a bipartite graph acyclic. I hope someone could help me out here. The problem statement is described below:
Consider an undirected bipartite ...
0
votes
0answers
15 views
Travelling Salesman Shipping Depreciating Items to Different Markets
What would be a good heuristic to use to solve the following challenge?
Quality Blimps Inc. is looking to expand their sales to other cities
(N), so they hired you as a salesman to fly to other ...