Amazon Interview Report
- 0of 0 votes
AnswersChange the structure of a Tree node to hold a pointer for the next in-order element (sucessor).
- rodrigoreis22 January 22, 2013 in United States
Given a Binary Search Tree.. transform it on a LinkedList by setting the next pointer described above.
Maybe this is a duplicate question.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Trees and Graphs - 0of 0 votes
AnswersImplement a shared int pointer in C++ (SharedIntPtr).. the use would be like this:
SharedIntPtr a(new int); // reference count 1; SharedIntPtr b(a); // reference count 2; *a = 2; cout << *b; // "2"; a.reset(); // reference count -> 1 *a // <- NULL b.reset(); // reference count ->0 , object is deleted.
There is also this reference count which tells how many references do you have.
- rodrigoreis22 January 22, 2013 in United States
And the question was: Implement SharedIntPtr, constructors and reset().| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.