Leetcode(排序)
luxialan
这个作者很懒,什么都没留下…
展开
-
Search for a Range
Search for a RangeGiven 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 order of O(log原创 2015-04-10 15:34:19 · 545 阅读 · 0 评论 -
Merge Two Sorted Lists
Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists./**原创 2015-04-08 21:59:17 · 406 阅读 · 0 评论 -
Merge Sorted Array
Merge Sorted ArrayGiven two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal to m + n) to hold a原创 2015-04-08 21:52:41 · 413 阅读 · 0 评论 -
First Missing Positive
First Missing PositiveGiven an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm should run in原创 2015-04-09 17:13:44 · 453 阅读 · 0 评论 -
Insertion Sort List
Insertion Sort List Sort a linked list using insertion sort.很简单的一道题,思路跟数组的插入排序一样/** * Definition for singly-linked list. * struct ListNode { * int val; * Li原创 2015-04-09 11:26:52 · 365 阅读 · 0 评论