[algogeeks] Re: Algo.. phone book

2007-11-10 Thread Andrey
just store list of phone number as leaf in trie. What abt collisions in Trie?? Like if same name then??? Still don't understand why you all so eager to use Trie, in my point of view this is improper data structure in this case. --~--~-~--~~~---~--~~ You

[algogeeks] Re: Discussion on unique-elements-in-an-array

2007-11-10 Thread Andrey
No, it is not. Read carefully the article on Wikipedia. There is a very detailed explanation of the algorithm. Heap is build in an array being sorted. It's the strongest feature of the algorithm. On Nov 9, 4:51 pm, Pramod Negi [EMAIL PROTECTED] wrote: i think if array of n elements is given

[algogeeks] Re: Graph coloring algos.

2007-11-10 Thread dor
One example: http://www.cs.ualberta.ca/~joe/Coloring/ . On Oct 22, 3:05 am, Lukas Šalkauskas [EMAIL PROTECTED] wrote: I need experimentally compare RLF and DSATUR graph coloring heuristics algorithms. Maybe anyone have some information, or maybe some optimized peas of code ? :) Lukas. --

[algogeeks] Re: Algo.. phone book

2007-11-10 Thread Varun S V
HI, The phone numbers can be stored at the leaf nodes as said by andrey. And why will there be a collission? All the names stored has to unique. If the names are not unique then we must have an extra pointer to the leaf node, which stores the list of phone numbers, so that the multiple entried are

[algogeeks] Re: Hashing Algo

2007-11-10 Thread MartinH
On Nov 9, 6:10 pm, Rajat Gogri [EMAIL PROTECTED] wrote: Hello, I was asked this question for MSFT interview. You are given Symbols for stock ticker application, All are 4 character , Capital letters only so min is and max is . for example MSFT, GOOG etcetc How will you hash

[algogeeks] Re: Hashing Algo

2007-11-10 Thread MartinH
On Nov 10, 4:53 pm, MartinH [EMAIL PROTECTED] wrote: On Nov 9, 6:10 pm, Rajat Gogri [EMAIL PROTECTED] wrote: I was asked this question for MSFT interview. You are given Symbols for stock ticker application, How will you hash it??? Personally I would call above a *vector table* not a

[algogeeks] An effective search algorithm for the subset sum problem

2007-11-10 Thread Yao Ziyuan
An effective search algorithm for the subset sum problem Problem: There are n integers N_1, N_2, ..., N_n; we wonder if the sum of some or all of these integers (a subset sum) is 0. Solution: Suppose (1) There are p different prime numbers P_1, P_2, ..., P_p; (2) P_1 * P_2 *