Frage im Vorstellungsgespräch bei Microsoft

BFS on a binary tree

Antwort im Vorstellungsgespräch

Anonym

6. Aug. 2010

fun bfs(t,k) if (t is null) return not-found if (t.key is k) return t if (t is leaf) else r = bfs(t.left,k) if (r is not-found) r = bfs(t.right,k) return r