码迷,mamicode.com
首页 >  
搜索关键字:sorted    ( 5925个结果
Convert Sorted List to Binary Search Tree
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.思路:使用两个指针分别以1、2的速度遍历链表,以定位出链表的中点,进而将链表分割成...
分类:其他好文   时间:2014-08-17 02:21:36    阅读次数:246
leetcode 刷题之路 93 Merge k Sorted Lists
将k个有序链表合并成一个有序链表。...
分类:其他好文   时间:2014-08-16 21:06:21    阅读次数:186
Leetcode--Remove Duplicates from Sorted Array
Problem Description:Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not alloca...
分类:其他好文   时间:2014-08-16 12:20:20    阅读次数:129
[leetcode]Convert Sorted List to Binary Search Tree
Convert Sorted List to Binary Search TreeGiven a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST....
分类:其他好文   时间:2014-08-16 12:19:20    阅读次数:227
LeetCode——Merge Sorted Array
Given 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 additional elements fro...
分类:其他好文   时间:2014-08-16 11:12:43    阅读次数:317
leetcode -- Merge Sorted Array
过去已无法改变,未来又难以琢磨,我们只能把握当下[问题描述]Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space ...
分类:其他好文   时间:2014-08-15 21:02:49    阅读次数:165
LeetCode (1) Merge Sorted Array
题目: Given two sorted integer arrays A and B, merge B into A as one sorted array. Note: You may assume that A has enough space to hold additional elements from B. The number of elements initia...
分类:其他好文   时间:2014-08-15 18:00:09    阅读次数:194
【Leetcode长征系列】Merge k Sorted Lists
原题: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 思路:两条两条地合并。时间复杂度为O(n),n为所有链表节点和。 代码: /** * Definition for singly-linked list. * struct List...
分类:其他好文   时间:2014-08-14 20:52:09    阅读次数:275
【HackerRank】Find the Median(Partition找到数组中位数)
In the Quicksort challenges, you sorted an entire array. Sometimes, you just need specific information about a list of numbers, and doing a full sort ...
分类:其他好文   时间:2014-08-14 20:10:19    阅读次数:275
Search Insert Position
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...
分类:其他好文   时间:2014-08-14 10:27:38    阅读次数:181
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!