摘要: Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowes 阅读全文
posted @ 2017-12-03 12:51 逸朵 阅读(146) 评论(0) 推荐(0)
摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia 阅读全文
posted @ 2017-12-03 11:47 逸朵 阅读(156) 评论(0) 推荐(0)
摘要: Given an integer, write a function to determine if it is a power of two. 阅读全文
posted @ 2017-12-03 11:29 逸朵 阅读(101) 评论(0) 推荐(0)
摘要: Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST's 阅读全文
posted @ 2017-12-03 09:44 逸朵 阅读(115) 评论(0) 推荐(0)
摘要: Given a sorted integer array without duplicates, return the summary of its ranges. Example 1: Example 2: 阅读全文
posted @ 2017-12-03 08:36 逸朵 阅读(136) 评论(0) 推荐(0)
摘要: Invert a binary tree. to 阅读全文
posted @ 2017-12-03 08:02 逸朵 阅读(112) 评论(0) 推荐(0)
摘要: Implement a basic calculator to evaluate a simple expression string. The expression string may contain open ( and closing parentheses ), the plus + or 阅读全文
posted @ 2017-12-03 07:50 逸朵 阅读(141) 评论(0) 推荐(0)
摘要: Find the total area covered by two rectilinear rectangles in a 2D plane. Each rectangle is defined by its bottom left corner and top right corner as s 阅读全文
posted @ 2017-12-03 07:18 逸朵 阅读(118) 评论(0) 推荐(0)
摘要: Given a complete binary tree, count the number of nodes. Definition of a complete binary tree from Wikipedia:In a complete binary tree every level, ex 阅读全文
posted @ 2017-12-03 03:10 逸朵 阅读(157) 评论(0) 推荐(0)