4 ms·
At my one phone-screen with Google a long time ago: decide if all nodes in a binary tree fullfil the condition that elements in the left sub-tree are smaller th
by henrik_w 10y ago
At my one phone-screen with Google a long time ago: decide if all nodes in a binary tree fullfil the condition that elements in the left sub-tree are smaller than or equal to the node value, and all elements in the right sub-tree are greater than or equal. Good question I think, since you need to be able to use recursion + a tree is a simple and useful data structure.