reducing more complexity of the tree is not binary, it will be like below instead of node containning the name
it will have a (character,count , & is_last_char_of_string) the complexity for searching the word is present or not is length_of_word now we can create tree like this words ( bob,jim,jack,abi) root / | \ b J a | / | | o a i b | | | | b c m i | k On 16-10-2010 01:48, tech rascal wrote:
u can do it by making binary search tree and each node should has 2 data parts i.e, name and count. Whnevr u encounter the same name, update the count of that corresponding node else keep on extending the tree.On Fri, Oct 15, 2010 at 7:00 AM, Kumar S <kush...@gmail.com <mailto:kush...@gmail.com>> wrote:Q : A file has list of names. We need an algorithm to find the number each names repeats in that list. NOT case sensitive Example... namefile.txt has the content...... bob abi jack ram jim tim joey riya kris bob kris ram jack joe joe joey bob bob bob kris joe this has more than 32000 in the list.. not limited number . Output : must have the distinct names and the count against them.. Appreciate your inputs. Thanks n have a good one-- You received this message because you are subscribed to the GoogleGroups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com <mailto:algogeeks@googlegroups.com>. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com <mailto:algogeeks%2bunsubscr...@googlegroups.com>. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. --You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group.To post to this group, send email to algogeeks@googlegroups.com.To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
-- Thanks & Regards Rajesh Patidar -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
<<inline: signature.png>>