Problem 3831 · Medium

Median of a Binary Search Tree Level

Collect one depth of a search tree with a level-order walk, sort those values, and take the upper middle.

Open the interactive visualisation