Pergunta de entrevista da empresa Amazon

Build a function which returns some random node from a binary tree every time it is been called.

Resposta da entrevista

Sigiloso

2 de dez. de 2012

Traverse the node.Store nodes in hashmap. Use random function which returns val between the number of nodes (use counter to count nodes while traversing) .Retrive node from map using ran num as key.