上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 23 下一页
摘要: You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up:Could you do this in-place? 此题可以用3*3的矩阵来 阅读全文
posted @ 2017-02-02 14:56 CodesKiller 阅读(87) 评论(0) 推荐(0) 编辑
摘要: Given a data stream input of non-negative integers a1, a2, ..., an, ..., summarize the numbers seen so far as a list of disjoint intervals. For exampl 阅读全文
posted @ 2017-02-02 14:28 CodesKiller 阅读(240) 评论(0) 推荐(0) 编辑
摘要: Given a sorted integer array where the range of elements are in the inclusive range [lower, upper], return its missing ranges. For example, given [0, 阅读全文
posted @ 2017-02-02 13:34 CodesKiller 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Given a sorted integer array without duplicates, return the summary of its ranges. For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"]. 此题方法是 阅读全文
posted @ 2017-02-02 12:24 CodesKiller 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * Definition for singly-linked list. 3 * public class ListNode { 4 * int val; 5 * ListNode next; 6 * ListNode(int x) { val = x; } 7 * } 8 */ 9 public class Solutio... 阅读全文
posted @ 2017-02-02 11:47 CodesKiller 阅读(316) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3].... Example:(1) Given nums = [1, 5, 1, 1, 6, 4], one possible 阅读全文
posted @ 2017-02-02 09:37 CodesKiller 阅读(314) 评论(0) 推荐(0) 编辑
摘要: Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For exam 阅读全文
posted @ 2017-02-02 08:08 CodesKiller 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 快速排序是一个知名度极高的排序算法,其对于大数据的优秀排序性能和相同复杂度算法中相对简单的实现使它注定得到比其他算法更多的宠爱。 算法概述/思路 快速排序一般基于递归实现。其思路是这样的: 1.选定一个合适的值(理想情况中值最好,但实现中一般使用数组第一个值),称为“枢轴”(pivot)。 2.基于 阅读全文
posted @ 2017-02-02 07:19 CodesKiller 阅读(9864) 评论(0) 推荐(2) 编辑
摘要: Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3].... For example, given nums = [3, 5, 2, 1, 6, 4], 阅读全文
posted @ 2017-02-02 03:07 CodesKiller 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, 阅读全文
posted @ 2017-02-02 02:59 CodesKiller 阅读(115) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 23 下一页