摘要: Lowest Common Ancestor of a Binary Tree Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the de 阅读全文
posted @ 2020-07-21 16:29 十三w~w 阅读(88) 评论(0) 推荐(0) 编辑
摘要: Kth Smallest Element in a BST Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Example 1: Input: root 阅读全文
posted @ 2020-07-21 10:03 十三w~w 阅读(68) 评论(0) 推荐(0) 编辑
摘要: Majority Element II Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Note: The algorithm should run in linear 阅读全文
posted @ 2020-07-21 09:53 十三w~w 阅读(93) 评论(0) 推荐(0) 编辑