Question d’entretien chez Amazon

Given a binary search tree, search for the second largest element.

Réponse à la question d'entretien

Utilisateur anonyme

17 mai 2012

Perform an in-order traversal, but for every node, search for the right child first instead of the left child. The second visited node should be the second largest one.

2