2015年3月8日

Remove Duplicates from Sorted Array II

摘要: Remove Duplicates from Sorted Array II问题:Follow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted array ... 阅读全文

posted @ 2015-03-08 20:08 zhouzhou0615 阅读(121) 评论(0) 推荐(0)

Plus One

摘要: Plus One问题:Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant ... 阅读全文

posted @ 2015-03-08 19:51 zhouzhou0615 阅读(127) 评论(0) 推荐(0)

Container With Most Water

摘要: Container With Most Water问题:Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn suc... 阅读全文

posted @ 2015-03-08 19:41 zhouzhou0615 阅读(141) 评论(0) 推荐(0)

Search a 2D Matrix

摘要: Search a 2D Matrix问题:Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each ... 阅读全文

posted @ 2015-03-08 16:26 zhouzhou0615 阅读(181) 评论(0) 推荐(0)

Find Minimum in Rotated Sorted Array II

摘要: Find Minimum in Rotated Sorted Array II问题:Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-t... 阅读全文

posted @ 2015-03-08 15:59 zhouzhou0615 阅读(144) 评论(0) 推荐(0)

Search in Rotated Sorted Array II

摘要: Search in Rotated Sorted Array II问题:Follow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complex... 阅读全文

posted @ 2015-03-08 15:21 zhouzhou0615 阅读(153) 评论(0) 推荐(0)

Search in Rotated Sorted Array

摘要: Search in Rotated Sorted Array问题:Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 ... 阅读全文

posted @ 2015-03-08 11:09 zhouzhou0615 阅读(156) 评论(0) 推荐(0)

Find Minimum in Rotated Sorted Array

摘要: Find Minimum in Rotated Sorted Array问题:Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 ... 阅读全文

posted @ 2015-03-08 10:26 zhouzhou0615 阅读(135) 评论(0) 推荐(0)

Remove Duplicates from Sorted Array

摘要: Remove Duplicates from Sorted Array问题:Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new le... 阅读全文

posted @ 2015-03-08 09:53 zhouzhou0615 阅读(112) 评论(0) 推荐(0)

Spiral Matrix

摘要: Spiral Matrix问题:Given a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.思路: 矩阵螺旋访问模板我的代码:public class Soluti... 阅读全文

posted @ 2015-03-08 09:33 zhouzhou0615 阅读(160) 评论(0) 推荐(0)

导航