Domanda di colloquio di Microsoft

BFS on a binary tree

Risposta di colloquio

Anonimo

6 ago 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