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> 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 Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<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 algoge...@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.

Reply via email to