vijay
BAN USER
Comments (5)
Reputation 20
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
Hi
in this way the cost is more in two phases
Phase 1: while updating the list, need to check the each node untill finding the matched one and increase the frequency, else add the new node.
Phase 2: in finding the 'n' number of occurances , need to traverse the list again.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
i did not tested the below code , just tried to give simple algorithm
improvements to do : do with out array size var xlen
- vijay September 17, 2014