Frage im Vorstellungsgespräch bei KeyValue Software Systems

Find the second largest element in a binary-tree

Antworten zu Vorstellungsgespräch

Anonym

2. Sept. 2019

implement an algorithm of time complexity O(1)

4

Anonym

29. Jan. 2020

Start traversing the tree, a) If the current node data say root->key is greater than first->key then update first and second as, second = first first = root b) If the current node data is in between first and second, then update second to store the value of current node as second = root