/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) { val = x; }
* }
*/
class Solution {
int m=0;
int n=0;
public int kthLargest(TreeNode root, int k) {
if(root==null){
return -1;
}
kthLargest(root.right,k);
m++;
if(k==m){
n=root.val;
return root.val;
}
kthLargest(root.left,k);
return n;
}
}