码迷,mamicode.com
首页 >  
搜索关键字:sorted    ( 5925个结果
【leetcode刷题笔记】Merge k Sorted Lists
Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.题解:最开始用了最naive的方法,每次在k个链表头中找出最小的元素,插入到新链表中。结果果断TLE了。分析...
分类:其他好文   时间:2014-07-23 16:56:31    阅读次数:227
【leetcode刷题笔记】Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->2->3-...
分类:其他好文   时间:2014-07-23 12:20:16    阅读次数:205
Remove Duplicates from Sorted List II leetcode java
题目:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1....
分类:编程语言   时间:2014-07-23 12:01:46    阅读次数:312
Merge Two Sorted Lists leetcode java
题目: Merge 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. 题解:....
分类:编程语言   时间:2014-07-23 12:01:36    阅读次数:257
Remove Duplicates from Sorted List leetcode java
题目:Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3-....
分类:编程语言   时间:2014-07-23 12:01:16    阅读次数:239
Median of Two Sorted Array leetcode java
题目: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-07-23 11:49:36    阅读次数:357
[leetcode]Remove Duplicates from Sorted Array II
Remove Duplicates from Sorted Array IIFollow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted array A =...
分类:其他好文   时间:2014-07-22 22:48:13    阅读次数:201
Search in Rotated Sorted Array II leetcode java
题目:Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?Write a funct....
分类:编程语言   时间:2014-07-22 22:47:55    阅读次数:214
【leetcode刷题笔记】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.题解:开始想到的方法比较偷懒,直接遍历一遍数组,把每个ListNode对应的值放到...
分类:其他好文   时间:2014-07-22 22:45:13    阅读次数:271
poj 1094
Sorting It All Out Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 26911   Accepted: 9285 Description An ascending sorted sequence of distinct values is one ...
分类:其他好文   时间:2014-07-22 22:38:36    阅读次数:166
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!