码迷,mamicode.com
首页 >  
搜索关键字:sorted lists    ( 7805个结果
LeetCode::Remove Duplicates from Sorted List II [具体分析]
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2-...
分类:其他好文   时间:2014-07-07 16:17:00    阅读次数:139
leetcode - 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 ...
分类:其他好文   时间:2014-07-07 14:06:19    阅读次数:221
[leetcode] Search in Rotated Sorted Array II
Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed?
分类:其他好文   时间:2014-07-07 13:07:00    阅读次数:153
[leetcode] Remove Duplicates from Sorted Array II
Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?
分类:其他好文   时间:2014-07-03 11:51:05    阅读次数:117
[leetcode] Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once.
分类:其他好文   时间:2014-07-02 00:33:49    阅读次数:204
[leetcode] Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
分类:其他好文   时间:2014-07-02 00:24:04    阅读次数:284
二分法查找 --JS 实现
var indexOfSorted = function f(arr,n){ //assume : arr has been sorted var low = 0; var high = arr.length - 1; var mid = (low + high) / 2; while(high - low > 1){ if(n == arr[low]){return low...
分类:Web程序   时间:2014-06-30 08:54:10    阅读次数:978
UBUntu 软件 源配置方法
最近公司产品需要增加一个功能,就是版本自动更新,使用apt-get 实现。apt-get 软件源配置的方法,参见本人资源里的共享。下面是代码中作为升级的一部分。  FILE *fp; char buffer[256]; char source_ok[] = "Reading package lists..."; if(0 > system("mv -f /etc/apt/sources....
分类:其他好文   时间:2014-06-30 08:37:47    阅读次数:228
排序(5)---------快速排序(C语言实现)
快速排序使用分治法(Divide and conquer)策略来把一个串行(list)分为两个子串行(sub-lists)。 步骤为: 1,从数列中挑出一个元素,称为 "基准", 2,重新排序数列,所有元素比基准值小的摆放在基准前面,所有元素比基准值大的摆在基准的后面(相同的数可以到任一边)。在这个分区退出之后,该基准就处于数列的中间位置。这个称为分区操作。 3,递归地把小于基准值元素的子数列和大于基准值元素的子数列排序。 4,递归的最底部情形,是数列的大小是零或一,也就是永远都已经被排序好了。虽然一直递...
分类:编程语言   时间:2014-06-30 08:19:12    阅读次数:203
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 be O(log (m+n)). 方法 转换为寻找第k大的数。 ...
分类:其他好文   时间:2014-06-30 06:05:58    阅读次数:261
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!