上一页 1 ··· 4 5 6 7 8 9 10 11 下一页
  2015年4月22日
摘要: Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't mat... 阅读全文
posted @ 2015-04-22 10:53 黄瓜小肥皂 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, wh... 阅读全文
posted @ 2015-04-22 10:43 黄瓜小肥皂 阅读(125) 评论(0) 推荐(0) 编辑
  2015年4月21日
摘要: The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total number... 阅读全文
posted @ 2015-04-21 16:24 黄瓜小肥皂 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 1 /** 2 ... 阅读全文
posted @ 2015-04-21 15:40 黄瓜小肥皂 阅读(144) 评论(0) 推荐(0) 编辑
  2015年4月20日
摘要: A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any point ... 阅读全文
posted @ 2015-04-20 17:29 黄瓜小肥皂 阅读(154) 评论(0) 推荐(0) 编辑
  2015年4月19日
摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Find the minimum element.Yo... 阅读全文
posted @ 2015-04-19 21:21 黄瓜小肥皂 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST.采用二分递归。 1 class Solution { 2 public: 3 TreeNode *... 阅读全文
posted @ 2015-04-19 20:29 黄瓜小肥皂 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 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 distinct ways can you cli... 阅读全文
posted @ 2015-04-19 19:02 黄瓜小肥皂 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, ... 阅读全文
posted @ 2015-04-19 18:57 黄瓜小肥皂 阅读(124) 评论(0) 推荐(0) 编辑
  2015年4月18日
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1... 阅读全文
posted @ 2015-04-18 20:04 黄瓜小肥皂 阅读(132) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 下一页