Question d’entretien chez Applify

One question that I can recall is to implement a depth-first search algorithm for a binary tree without using recursion.

Réponse à la question d'entretien

Utilisateur anonyme

9 janv. 2024

So, basically, I had to figure out how to explore a binary tree without using the usual recursive method. The trick was to maintain a stack, put nodes in a specific order, and deal with each one as I go through the tree. The code I wrote shows a way to do this in a step-by-step, iterative fashion.