shani
BAN USER- 0of 0 votes
AnswersGive a Data structure to store Name-value pair like name-age
- shani in India
"abc",12
"xyz",34...
such than insert(name,value), value = search(name), name = nthentry(n), delete(name); all can be perfomed in O(1).
Note:- after deletion order should be maintained.Ex.
"ds",12
"df",78
"teu",54
"etr",12
If delete("df") is called then nthentry(2) should return "teu"| Report Duplicate | Flag | PURGE
Adobe MTS Algorithm - 0of 0 votes
AnswersThere is one linked list having two pointer one as usual next and other is random pointer pointing to any random node in list.
- shani in India
write algo to make a duplicate of it.
Note:- Original list is const, Can't be modified.| Report Duplicate | Flag | PURGE
Adobe MTS Algorithm
yes, quick selection is the best choice. After partition, just check where (k-1)th index falls in search space, lower index to pivot index or pivot index to upper index, reduce search space by eliminating other till pivot element doesn't fall into (k-1)th index. in each partition search space will be reduced by half nearly.
Time Complexity O(n), if list not already sorted.
Repjohnagragg0, cox customer service at Deloitte Consulting LLP
I am friendly, I am a hard worker, even through difficult circumstances, I want to know about How to identify ...
@Dhamu
- shani October 31, 2012Can u please elaborate for this example(5 nodes):
abcdef -> ghihgfed -> c -> b -> a