# Recent questions tagged algorithm

276 views
this is the code ::::::: import dsa.DiGraph; import dsa.SeparateChainingHashST; import dsa.Set; import stdlib.In; import stdlib.StdOut; public class WordNet { //... ... %s) = %s\n", word1, word2, wordnet.distance(word1, word2)); } }...
494 views
pleas help me !. I need Dynamic programming in genetic algorithm for solving TSP. Initially I have taken two parents and substitute in one formula of ... offspring (crossover) for obtaining the best solution. I need implementaion part help...
354 views
In a book I encountered following question: Given N step stair, in how many number of ways can you climb if you use either 1, 2 or 3 steps at a time? Following is the ... cases i.e. (1,1,1), (1,2), (3). See Question&Answers more detail:os...
408 views I am trying to understand the minesweeper problem: Problem statement: Have you ever played Minesweeper? This cute little game comes with a certain operating ... problems , they are game projects. ) See Question&Answers more detail:os...
406 views
Suppose we have an infinite, complete binary tree where the nodes are numbered 1, 2, 3, ... by their position in a layer-by-layer traversal ... we efficiently find the shortest path between them? Thanks! See Question&Answers more detail:os...
384 views I have solved this problem!!! I found that if i have to use vector<Node*> children;. But I am not very sure the reason, can someone tell me why? ... PREV; PREV->children.push_back(*cur); PREV = cur; } See Question&Answers more detail:os...
377 views
If the time complexity of my program is,say O(n^2),How do I express running time in terms of seconds for a large value of n,10^6 ? I need ... ....It's about estimation of running time from Time complexity See Question&Answers more detail:os...
347 views
I have one value like 24, and I have four textboxes. How can I dynamically generate four values that add up to 24? All the values must be integers and can't be ... 4. (But 5, 6, 6, 7 would be okay.) See Question&Answers more detail:os...
336 views
I'm having trouble understanding how to make this into a formula. for (int i = 1; i <= N; i++) { for (int j = 1; j <= N; j += i) { ... ) How would be best to try and think this as a function of N? See Question&Answers more detail:os...
412 views
Why multi-paxos is called multi-paxos? I can't see how it is "multi". See Question&Answers more detail:os...
343 views
While answering to this question a debate began in comments about complexity of QuickSort. What I remember from my university time is that QuickSort is O( ... can someone state it more rigorously than I ? See Question&Answers more detail:os...
228 views
I have a directed weighted graph G=(V,E), which may have loops. I am trying to determine the best time efficient algorithm to accomplish task: to ... and maybe there are better algorithms to solve this. See Question&Answers more detail:os...
338 views
I recently implemented the UDFs of the Damerau-Levenshtein algorithms into MySQL, and was wondering if there is a way to combine the fuzzy matching of ... of it appearing anyway within the Text field. See Question&Answers more detail:os...
431 views
void swap(ref int x, ref int y) { x = x ^ y; y = y ^ x; x = x ^ y; } im learning about bitwise XOR. how is this swapping occurring? it's ... of X and Y, but i dont understand AT ALL what is going on? See Question&Answers more detail:os...
371 views
I have a List<List<String>> I need to get a List of all possible concatenation on the first dimension [ [1,2 ],  , [3,4] ] ... ; indexList.add(l); System.out.println( constructIndexes(indexList)); See Question&Answers more detail:os...
254 views I'm sure there must exist a way to do the following but I don't know what it's called so I cannot google it. I need an algorithm to go from A to B ... ) -> OUT Polygon { //The algorithm I need goes here } See Question&Answers more detail:os...
287 views I have a matching problem, which I think is np-hard: We need to arrange a dinner for a group of n people, some of the people are friends with ... but i would be very gratefull for any ideas for solutions See Question&Answers more detail:os...
334 views
I'm looking to explore different algorithms, both recursive and dynamic programming, that checks if one arrayA is a subsequence of arrayB. For ... algorithms to compute the longest increasing subsequence. See Question&Answers more detail:os...
352 views
I came up with this question. There is an encryption algorithm which uses bitwise XOR operations extensively. This encryption algorithm uses a sequence of non- ... . Maximum time limit in java is 5sec. See Question&Answers more detail:os...
337 views I have a number plate which is a binary image. I performed dilation to the image to thicken the edges then "flood filling", lastly erosion for thinning: ... figure();imshow(ab,[]); title('floodFilling'); See Question&Answers more detail:os...
377 views
How to Implement using recursion and cut-off cycle of the counter (like for i: = 1 downto N do <operator>) ? See Question&Answers more detail:os...
255 views
Is there a way to generate all of the subset sums s1, s2, ..., sk that fall in a range [A,B] faster than O((k+N)*2N/2), where ... order of millions, so I haven't considered the dynamic programming route. See Question&Answers more detail:os...
584 views
I have two sets of data taken from two separate import files which are both being imported into python and have currently been placed in lists as ... solution, any help would be really appreciated. Cheers See Question&Answers more detail:os...
299 views
So for example, the answer for the array: 1, 11, 3, 95, 23, 8, 1 would be 1, since all the other elements only occur once while 1 occurs ... showing why it's impossible? Including a source would be nice. See Question&Answers more detail:os...
350 views