码迷,mamicode.com
首页 >  
搜索关键字:sorted    ( 5925个结果
Merge Two Sorted Lists
1 /** 2 * Definition for singly-linked list. 3 * public class ListNode { 4 * int val; 5 * ListNode next; 6 * ListNode(int x) { 7 * ...
分类:其他好文   时间:2014-10-13 13:30:09    阅读次数:118
leetcode - Remove Duplicates from Sorted Array II
Follow up for "Remove Duplicates": What if duplicates are allowed at most twice? For example, Given sorted array A = [1,1,1,2,2,3], Your function should return length = 5, and A is now [1,1,2,...
分类:其他好文   时间:2014-10-12 19:42:38    阅读次数:141
为什么有序数组比无序数组快呢?
来自stackoverflow的题目Why is processing a sorted array faster than an unsorted array?...
分类:编程语言   时间:2014-10-12 18:15:58    阅读次数:296
leetcode - Search in Rotated Sorted Array II
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 function to determine if a given target is in the...
分类:其他好文   时间:2014-10-12 16:06:48    阅读次数:185
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->3->3->4->4->5, return 1->2->5. Given 1->1-...
分类:其他好文   时间:2014-10-12 15:51:58    阅读次数:190
leetcode - Remove Duplicates from Sorted List
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->3, return 1->2->3. /** * Definition for s...
分类:其他好文   时间:2014-10-12 13:59:18    阅读次数:182
python的排序和查询
#encoding=utf-8__author__ = 'kevinlu1010@qq.com'################# python自带的排序接口 ###################### python内带非常强大的排序函数,sorted,或sort# sorted是内建函数,sor...
分类:编程语言   时间:2014-10-12 11:54:27    阅读次数:242
leetcode dfs Convert Sorted List to Binary Search Tree
Convert Sorted List to Binary Search Tree  Total Accepted: 21420 Total Submissions: 78476My Submissions Given a singly linked list where elements are sorted in ascending order, convert it ...
分类:其他好文   时间:2014-10-12 00:00:36    阅读次数:250
LeetCode Merge k Sorted Lists 解题报告
合并K个已排序的数组,并分析整个算法的复杂度。 最朴素的方法TLE,借鉴归并排序的算法顺利AC,算法时间复杂度:NlogK...
分类:其他好文   时间:2014-10-11 19:08:45    阅读次数:113
windows下安装redis
windows下安装redis1、redis简介redis是一个key-value存储系统。和Memcached类似,它支持存储的value类型相对更多,包括string(字符串)、list(链表)、set(集合)、zset(sorted set --有序集合)和hashs(哈希类型)。这些数据类型...
分类:Windows程序   时间:2014-10-11 19:03:26    阅读次数:325
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!