上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 33 下一页
摘要: 题目: 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 l 阅读全文
posted @ 2015-11-28 23:56 YRB 阅读(2521) 评论(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 Wikip 阅读全文
posted @ 2015-11-28 22:30 YRB 阅读(1909) 评论(2) 推荐(0) 编辑
摘要: 题目: Given a singly linked list, determine if it is a palindrome. Follow up:Could you do it in O(n) time and O(1) space? 链接: http://leetcode.com/proble 阅读全文
posted @ 2015-11-28 11:07 YRB 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.For example:Given n = 13,Retur... 阅读全文
posted @ 2015-11-28 10:40 YRB 阅读(661) 评论(0) 推荐(0) 编辑
摘要: 题目: Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of queue. pop() -- Removes the element from in f 阅读全文
posted @ 2015-11-27 12:35 YRB 阅读(736) 评论(0) 推荐(0) 编辑
摘要: 题目: Given an integer, write a function to determine if it is a power of two. 链接: http://leetcode.com/problems/power-of-two/ 题解: 验证一个数是否是2的幂次,我们可以使用(n 阅读全文
posted @ 2015-11-27 11:43 YRB 阅读(237) 评论(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 ≤ B 阅读全文
posted @ 2015-11-26 22:43 YRB 阅读(2515) 评论(0) 推荐(0) 编辑
摘要: 题目: Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space 阅读全文
posted @ 2015-11-26 12:38 YRB 阅读(481) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a sorted integer array without duplicates, return the summary of its ranges. For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"]. 链 阅读全文
posted @ 2015-11-26 04:57 YRB 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 题目:Implement a basic calculator to evaluate a simple expression string.The expression string contains onlynon-negativeintegers,+,-,*,/operators and em... 阅读全文
posted @ 2015-11-26 04:15 YRB 阅读(750) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 33 下一页