上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页
摘要: 问题描述Given an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three integers. Y... 阅读全文
posted @ 2015-07-25 10:22 Chapter 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 二分查找的前提条件是数组是完全有序或者部分有序,其时间复杂度通常为O(logn).二分查找模板(可应对多种不同需求)public class BinarySearchTemplate {public int binarySearch(int[] nums, int target) { if (num... 阅读全文
posted @ 2015-07-25 09:42 Chapter 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 问题描述Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example,Given the following matrix:[ ... 阅读全文
posted @ 2015-07-24 09:59 Chapter 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 问题描述Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [... 阅读全文
posted @ 2015-07-24 09:10 Chapter 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 问题描述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 digit i... 阅读全文
posted @ 2015-07-24 08:52 Chapter 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 问题描述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... 阅读全文
posted @ 2015-07-24 08:33 Chapter 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 问题描述Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorte... 阅读全文
posted @ 2015-07-23 14:54 Chapter 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 问题描述Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) - Get... 阅读全文
posted @ 2015-07-23 14:40 Chapter 阅读(150) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/jason0539/article/details/44956775 阅读全文
posted @ 2015-07-20 16:41 Chapter 阅读(91) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/liujiahan629629/article/details/18013523 阅读全文
posted @ 2015-07-20 12:14 Chapter 阅读(85) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页