码迷,mamicode.com
首页 >  
搜索关键字:sorted    ( 5925个结果
【leetcode刷题笔记】Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu...
分类:其他好文   时间:2014-07-22 23:12:13    阅读次数:426
【CareerCup】Trees and Graphs—Q4.3
题目: Given a sorted (increasing order) array, write an algorithm to create a binary tree with minimal height. 翻译: 给定一个有序数组(递增),写程序构建一棵具有最小高度的二叉树。 思路: 要使二叉树的高度最小,则要尽量使其左右子树的节点数目相当,自然就考虑到将其构造成为二叉排序树,且将有序数组的中间大的数作为根节点,这样得到的二叉树的高度便是最小的。...
分类:其他好文   时间:2014-05-01 17:48:45    阅读次数:321
leetcode__Merge k Sorted Lists
Merge k Sorted Lists  Total Accepted: 9746 Total Submissions: 41674My Submissions Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity....
分类:其他好文   时间:2014-05-01 17:11:32    阅读次数:234
LeetCode2:Median of Two Sorted Arrays
题目: There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should...
分类:其他好文   时间:2014-04-29 10:32:46    阅读次数:359
线性时间将两个有序链表合成一个有序链表(constant additional space)
description:given two sorted singly list, merge them into one using constant additional spacealgorithm:we will reference the two linked list as list1 ...
分类:其他好文   时间:2014-04-28 00:32:52    阅读次数:711
5925条   上一页 1 ... 591 592 593
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!