上一页 1 2 3 4 5 6 7 ··· 20 下一页
摘要: Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from l... 阅读全文
posted @ 2016-01-16 12:41 茜茜的技术空间 阅读(289) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ord... 阅读全文
posted @ 2016-01-15 08:48 茜茜的技术空间 阅读(625) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or... 阅读全文
posted @ 2016-01-15 04:21 茜茜的技术空间 阅读(355) 评论(0) 推荐(0) 编辑
摘要: Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's. 1... 阅读全文
posted @ 2015-11-14 09:56 茜茜的技术空间 阅读(178) 评论(0) 推荐(0) 编辑
摘要: A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message conta... 阅读全文
posted @ 2015-11-14 04:37 茜茜的技术空间 阅读(240) 评论(0) 推荐(0) 编辑
摘要: Given a 2D matrixmatrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1,col1) and lower right corner (row2,c... 阅读全文
posted @ 2015-11-14 04:02 茜茜的技术空间 阅读(236) 评论(0) 推荐(0) 编辑
摘要: Given an integer arraynums, find the sum of the elements between indicesiandj(i≤j), inclusive.Example:Given nums = [-2, 0, 3, -5, 2, -1]sumRange(0, 2)... 阅读全文
posted @ 2015-11-14 02:37 茜茜的技术空间 阅读(380) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor... 阅读全文
posted @ 2015-11-14 02:15 茜茜的技术空间 阅读(252) 评论(0) 推荐(0) 编辑
摘要: You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?解题思路:将每个[i, j]对应旋转对... 阅读全文
posted @ 2015-11-13 13:08 茜茜的技术空间 阅读(228) 评论(0) 推荐(0) 编辑
摘要: According to theWikipedia's article: "TheGame of Life, also known simply asLife, is a cellular automaton devised by the British mathematician John Hor... 阅读全文
posted @ 2015-11-13 04:52 茜茜的技术空间 阅读(303) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 20 下一页