/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ classSolution{ LinkedList<Integer> res = new LinkedList<>(); publicintkthLargest(TreeNode root, int k){ inOrder(root); int num = res.get(res.size()-k); return num; }