AirbnbSoftware Engineer · OnsiteCodemia practiceFind kth largest element in binary tree
Given a binary tree, write a function to find the kth largest element in the tree. The function should take the root of the binary tree and an integer k as input, and return the kth largest element as output. You may assume that k is always valid, and there are no duplicate elements in the tree.
Medium
Coding & Algorithms