Amazon Interview Report
- 0of 0 votes
AnswersWrite a program to make the following possible with any given tree.
- jeevanus November 17, 2014 in India for Hydrabad
6
/ \
3 5
/ \ \
2 5 4
/ \
7 4
There are 4 leaves, hence 4 root to leaf paths:
Path Sum
6->3->2 632
6->3->5->7 6357
6->3->5->4 6354
6->5>4 654
Answer = 632 + 6357 + 6354 + 654 = 13997| Report Duplicate | Flag | PURGE
Amazon SDE-2 - 0of 0 votes
AnswersSuggest a Data Structure to do the following opperations with time complexity O(1).
- jeevanus November 17, 2014 in India for Hydrabad
insert(int element); //insertes an element in O(1);
delete(int element); //deletes an element in O(1);
lookup(); // returns any element in random from the list at O(1);| Report Duplicate | Flag | PURGE
Amazon SDE-2