Let us create following BST 50 / \ 30 70 / \ / \ 20 40 60 80 / \ / \ / \ / \ 14 25 35 45 55 65 75 85
root = None NEW_LINE root = insert ( root , 50 ) NEW_LINE insert ( root , 30 ) NEW_LINE insert ( root , 20 ) NEW_LINE insert ( root , 40 ) NEW_LINE insert ( root , 70 ) NEW_LINE insert ( root , 60 ) NEW_LINE insert ( root , 80 ) NEW_LINE insert ( root , 14 ) NEW_LINE insert ( root , 25 ) NEW_LINE insert ( root , 35 ) NEW_LINE insert ( root , 45 ) NEW_LINE insert ( root , 55 ) NEW_LINE insert ( root , 65 ) NEW_LINE insert ( root , 75 ) NEW_LINE insert ( root , 85 ) NEW_LINE n = 15 NEW_LINE k = 5 NEW_LINE