krishna32
BAN USER
Comments (6)
Reputation 0
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.
0
of 0 vote
We need to use a linkedlist to store the positions of each number. And since we know that there are only ten numbers (1,2,3,4,5,6,7,8,9,0) we can use an array of size 10 instead of a hashtable. Hashtables are usually preferred when you do not the the number of key value pairs you would be storing. Each element in the array would be a linkedlist holding positions of the array index.
- krishna32 February 22, 2015Comment 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.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
what is the time and space complexity of the stack based approach??
- krishna32 May 07, 2015