码迷,mamicode.com
首页 >  
搜索关键字:complexity    ( 1097个结果
[LeetCode] Single Number
Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity...
分类:其他好文   时间:2014-07-07 23:24:09    阅读次数:210
Problem Sort List
Problem Description:Sort a linked list inO(nlogn) time using constant space complexity.Solution: 1 public ListNode sortList(ListNode head) { 2 ...
分类:其他好文   时间:2014-07-07 16:48:00    阅读次数:238
[leetcode] Minimum Window Substring
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).
分类:Windows程序   时间:2014-07-07 15:11:15    阅读次数:278
Single Number II
题目 Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it...
分类:其他好文   时间:2014-07-01 06:23:24    阅读次数:334
Single Number
题目 Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it witho...
分类:其他好文   时间:2014-06-30 19:38:37    阅读次数:226
Single Number II
题目 Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it...
分类:其他好文   时间:2014-06-30 19:23:18    阅读次数:200
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
leetCode: Single Number II [137]
【题目】 Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory? 【题意】 给定一个整数以外,其中除了一个整数只出现一次以外...
分类:其他好文   时间:2014-06-29 22:52:35    阅读次数:246
Minimum Window Substring
题目 Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). For example, S = "ADOBECODEBANC" T = "ABC" Minimum wi...
分类:Windows程序   时间:2014-06-29 20:38:14    阅读次数:239
LeetCode-Sort List(Python)
【问题】 Sort a linked list in O(n log n) time using constant space complexity. 【代码】 # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # ...
分类:编程语言   时间:2014-06-28 08:29:23    阅读次数:222
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!