什么是软件设计的复杂度软件技术发展的使命之一就是控制复杂度(Complexity)。从高级语言的产生,到结构化编程,再到面向对象编程、组件化编程等等。本文介绍通过分解、改善依赖关系,以及抽象的方式来降低复杂度。...
分类:
其他好文 时间:
2015-04-30 01:00:31
阅读次数:
255
Follow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Write a function to...
分类:
其他好文 时间:
2015-04-29 19:04:56
阅读次数:
111
problem:
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 ...
分类:
其他好文 时间:
2015-04-29 17:09:50
阅读次数:
112
There are two sorted arraysnums1andnums2of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should...
分类:
编程语言 时间:
2015-04-29 14:59:14
阅读次数:
139
Search in Rotated Sorted Array IIFollow 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...
分类:
编程语言 时间:
2015-04-27 18:32:37
阅读次数:
153
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 without using...
分类:
其他好文 时间:
2015-04-26 09:14:50
阅读次数:
108
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh...
分类:
编程语言 时间:
2015-04-23 23:14:57
阅读次数:
642
leet code Sort Listleet code Sort List对链表使用快慢指针归并排序Sort ListSort a linked list in O(n log n) time using constant space complexity./** * Definition for...
分类:
其他好文 时间:
2015-04-22 22:12:40
阅读次数:
123
Merge k Sorted Lists
Merge k sorted
linked lists and return it as one sorted list. Analyze and describe its complexity.
解题思路:
1、分治方法,两两合并。设每个链表的长度为n,有k个链表,那么每次合并最多扫描所有的元素,共扫描k/2+k/4+...+1=k次...
分类:
其他好文 时间:
2015-04-22 15:13:58
阅读次数:
127
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...
分类:
其他好文 时间:
2015-04-17 18:21:47
阅读次数:
122