摘要: 1.题目描述 Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The f 阅读全文
posted @ 2018-02-13 21:48 vlice 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 1.题目描述 Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime 阅读全文
posted @ 2018-02-13 21:37 vlice 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 1.题目描述 Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begi 阅读全文
posted @ 2018-02-12 21:32 vlice 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 1.题目描述 Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. 给出一个链表,返回链 阅读全文
posted @ 2018-02-12 21:22 vlice 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 1.题目描述 Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one tran 阅读全文
posted @ 2018-02-11 18:39 vlice 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 1.题目描述 Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5, Return [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6 阅读全文
posted @ 2018-02-11 18:20 vlice 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 1.题目描述 Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given 阅读全文
posted @ 2018-02-10 22:39 vlice 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 1.题目描述 Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the ne 阅读全文
posted @ 2018-02-10 22:29 vlice 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 1.题目描述 Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which 阅读全文
posted @ 2018-02-09 23:41 vlice 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 1.题目描述 Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tr 阅读全文
posted @ 2018-02-09 22:51 vlice 阅读(73) 评论(0) 推荐(0) 编辑