Amazon Interview Question
Software Engineer / DevelopersCountry: United States
Interview Type: In-Person
a) did you mean value inside each array element refers to parent? (i.e. index = node number and value = parent number)
b) if answer to a) is no, i.e. index = parent number and value = node number, then root node should have a value = index and not -1. otherwise its parent will be the node with number equal to root's index number.
Would you give an example.
- glebstepanov1992 February 11, 2014