摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文