Solution Review: Finding Kth Maximum Value in Binary Search Tree
Explore two approaches to find the kth maximum value in a binary search tree. Understand how sorting via in-order traversal and a more efficient recursive right-to-left traversal work. Learn the time complexities and how these methods can be implemented in C# to improve coding interview skills.
We'll cover the following...
We'll cover the following...
Solution 1: Sorting the tree in order #
In this solution, sort the tree in order by using a variation of the inOrderPrint() function that was studied in the “In-Order Traversal” lesson, and return the th last element!
Time complexity
This solution is in ...