摘要: #303. Range Sum Query - Immutable Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Note: 阅读全文
posted @ 2016-11-20 23:07 冯兴伟 阅读(727) 评论(0) 推荐(0)
摘要: #215. Kth Largest Element in an Array Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, 阅读全文
posted @ 2016-11-20 22:35 冯兴伟 阅读(131) 评论(0) 推荐(0)
摘要: #53. Maximum Subarray Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the 阅读全文
posted @ 2016-11-20 22:21 冯兴伟 阅读(211) 评论(0) 推荐(0)
摘要: #1. Two Sum Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input w 阅读全文
posted @ 2016-11-20 16:58 冯兴伟 阅读(137) 评论(0) 推荐(0)
摘要: #100. Same Tree Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structur 阅读全文
posted @ 2016-11-20 16:31 冯兴伟 阅读(207) 评论(0) 推荐(0)
摘要: #70. Climbing Stairs You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many dis 阅读全文
posted @ 2016-11-20 16:30 冯兴伟 阅读(418) 评论(0) 推荐(0)
摘要: #35. Search Insert Position Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would 阅读全文
posted @ 2016-11-20 16:28 冯兴伟 阅读(179) 评论(0) 推荐(0)
摘要: #21. Merge Two Sorted Lists Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of t 阅读全文
posted @ 2016-11-20 16:26 冯兴伟 阅读(178) 评论(0) 推荐(0)
摘要: #19. Remove Nth Node From End of List Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked lis 阅读全文
posted @ 2016-11-20 16:19 冯兴伟 阅读(119) 评论(0) 推荐(0)
摘要: 二分查找: 阅读全文
posted @ 2016-11-20 13:00 冯兴伟 阅读(1026) 评论(0) 推荐(0)
摘要: 伪代码: Java代码实现: 阅读全文
posted @ 2016-11-20 12:59 冯兴伟 阅读(702) 评论(0) 推荐(0)