上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 22 下一页
摘要: (Referrence: TutorialsPoint)Each of the collection classes provides an iterator( ) method that returns an iterator to the start of the collection. By ... 阅读全文
posted @ 2015-10-22 08:13 树獭君 阅读(119) 评论(0) 推荐(0) 编辑
摘要: QuestionGiven a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in... 阅读全文
posted @ 2015-10-19 08:09 树獭君 阅读(127) 评论(0) 推荐(0) 编辑
摘要: QuestionSuppose 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 2).You are given a target... 阅读全文
posted @ 2015-10-19 07:32 树獭君 阅读(179) 评论(0) 推荐(0) 编辑
摘要: QuestionGiven an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the followi... 阅读全文
posted @ 2015-10-19 06:57 树獭君 阅读(228) 评论(0) 推荐(0) 编辑
摘要: QuestionGiven a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1,... 阅读全文
posted @ 2015-10-19 05:46 树獭君 阅读(326) 评论(0) 推荐(0) 编辑
摘要: 这两个系列的题目其实是同一套题,可以互相转换。首先我们定义一个数组: prefixSum (前序和数组)Given nums: [1, 2, -2, 3]prefixSum: [0, 1, 3, 1, 4 ]现在我们发现对prefixSum做Best Time To Buy And Sell S... 阅读全文
posted @ 2015-10-19 05:11 树獭君 阅读(268) 评论(0) 推荐(0) 编辑
摘要: QuestionGiven a collection of integers that might contain duplicates,nums, return all possible subsets.Note:Elements in a subset must be in non-descen... 阅读全文
posted @ 2015-10-19 05:10 树獭君 阅读(343) 评论(0) 推荐(0) 编辑
摘要: QuestionGiven an array S ofnintegers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three int... 阅读全文
posted @ 2015-10-19 04:27 树獭君 阅读(274) 评论(0) 推荐(0) 编辑
摘要: QuestionGiven an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Not... 阅读全文
posted @ 2015-10-19 03:51 树獭君 阅读(231) 评论(0) 推荐(0) 编辑
摘要: QuestionA peak element is an element that is greater than its neighbors.Given an input array wherenum[i] ≠ num[i+1], find a peak element and return it... 阅读全文
posted @ 2015-10-18 13:41 树獭君 阅读(220) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 22 下一页