Given the root of a binary search tree, link all the nodes at the same level, by using an additional Node* level.
Sigiloso
Start from the root, put all the nodes in a queue, keep track of number of nodes at current level and at next level by counting, dequeue a node from the queue, put its left and right children in the queue by updating your counts, using your counts, connect the nodes at the same level. O(N) in both time and space.