Hi All,
I am looking for an algorithm, hint or any source code that can solve my following problem.
I have a folder it contains many text files. I read them and store all text in STRING. Now I want to to calculate, if any of the word appeared in other files or no. ( I know its not clear let me give an example)
For example i have two do...
I am trying to understand a code that I found online to fly the text in 3d using silverlight. The algorithm is not easy to understand for me as I am not familiar with these types of algos. Does somebody know a good book/resource that talks about these algos?
...
Hello,
I'm creating a web app in PHP where people can try to translate words they need to learn for school.
For example, someone needs to translate the Dutch word 'weer' to 'weather' in English, but unfortunately he types 'whether'. Because he almost typed the right word, I want to give him another try, with dots '.' on the places wher...
suppose i have a set of coins having denominations a1, a2, ... ak.
one of them is known to be equal to 1.
i want to make change for all integers 1 to n using the minimum number of coins.
any ideas for the algorithm.
eg. 1, 3, 4 coin denominations
n = 11
optimal selection is 3, 0, 2 in the order of coin denominations.
n = 12
optimal ...
Hi guys...
I want to simulate the semaphores (wait and signal procedure) with the message passing just in form of algorithm (and not code).
can anyone help me...?
...
From this Wikipedia article:
http://en.wikipedia.org/wiki/Hamiltonian_path_problem
A randomized algorithm for Hamiltonian
path that is fast on most graphs is
the following: Start from a random
vertex, and continue if there is a
neighbor not visited. If there are no
more unvisited neighbors, and the path
formed isn't Hami...
I've just come across a scenario in my project where it I need to compare different tree objects for equality with already known instances, and have considered that some sort of hashing algorithm that operates on an arbitrary tree would be very useful.
Take for example the following tree:
O
/ \
/ \
O O
...
I have a list of constant numbers. I need find the closest number to x, in the list of the numbers.
Any ideas on how to implement this alogrithm?
Thank You.
...
A graph is a subgraph of the graph in which any vertex is connected with the rest of vertexes.
In the k- problem, the input is an undirected graph and a number k, and the output is a clof size k if one exists (or, sometimes, all cl of size k)
...
How to obtain all the subgraphs of a fixed size from a graph, in pseudocode? (brute force)
Without external libraries if possible. Thanks!
...
I am trying to layout a bunch of overlapping rectangles that start out like this:
The 2-pass algorithm I thought up is roughly:
// Pass 1 - Move all rectangles to the right until they do not overlap any other rectangles
rects = getRectsSortedOnTopLeft(); // topmost first, all rects same size
foreach(rect in rects)
{
while(rect.col...
Does anyone know what is the worst possible asymptotic slowdown that can happen when programming purely functionally as opposed to imperatively (i.e. allowing side-effects)?
Clarification from comment by itowlson: is there any problem for which the best known non-destructive algorithm is asymptotically worse than the best known destruct...
Hi,
say I have a set of numbers '0', '1', '2', ..., '9'. I want to find all numbers that contain exactly one of each of the numbers in my set.
The problem is: Before I start my program, I do not know how many numbers and which numbers my set will include. (For example, the set could include the numbers '1', '3' and '14'.)
I searched t...
I need a help in making an algorithm for solving one problem: There is a row with numbers which appear different times in the row, and i need to find the number that appears the most and how many times it's in the row, ex:
1-1-5-1-3-7-2-1-8-9-1-2
That would be 1 and it appears 5 times.
The algorithm should be fast (that's my problem)...
Assuming all you have is the binary data and no pre-canned functions, is there a pattern or algorithm to categorize the type of character?
...
Working with PHP for this.
From a given set of items, each with its own weight, I need to automatically calculate the most effective way to package the items into 100 lbs packages (max package weight of 100 lbs is static, but can be changed in the future). A single package cannot exceed the maximum specified.
As an example, I have 5 i...
Hello,
I have an object with attributes ; startIndex, endIndex
I am able to do binary search based on startIndex by implementing the following :
int IComparable.CompareTo(object obj)
{
Repeat r = (Repeat)obj;
return this.startIndex.CompareTo(r.startIndex);
}
However with the same Repea...
Hello,
During an assignment, I was asked to show that a hash table of size m (m>3, m is prime) that is less than half full, and that uses quadratic checking (hash(k, i) = (h(k) + i^2) mod m) we will always find a free spot.
I've checked and arrived to the conclusion that the spots that will be found (when h(k)=0) are 0 mod m, 1 mod m, ...
Hi all,
I need an algorithm to find the best solution of a path finding problem. The problem can be stated as:
At the starting point I can proceed along multiple different paths.
At each step there are another multiple possible choices where to proceed.
There are two operations possible at each step:
A boundary condition that determi...
When I was in high school and learning about matrices, we were shown a technique that would help in a situation like this:
There are a number of chess players in a league, and they need to determine a ranking for all of them, but don't have enough time for every player to play every other person. If it ends up that Player A beats Player...