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 = "ADOBECOD ...
Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the or ...
分类:
其他好文 时间:
2016-09-14 11:06:13
阅读次数:
220
Sort a linked list in O(n log n) time using constant space complexity. 虽然知道要用mergesort,也懂mergesort,但没有自己实现过。真正上手的时候就不回=。=。参考了discussion的思路。 思路:找到linke ...
分类:
其他好文 时间:
2016-09-11 09:01:28
阅读次数:
152
Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. 思路: 首先末尾0的个数取决于素因数中2和5个数 ...
分类:
其他好文 时间:
2016-09-04 01:40:43
阅读次数:
187
1. 问题描述 Given an integer n, return the number of trailing zeroes in n!.Note: Your solution should be in logarithmic time complexity.Tags: MathSimilar ...
分类:
其他好文 时间:
2016-09-01 23:07:56
阅读次数:
353
Sort a linked list in O(n log n) time using constant space complexity. 思路:模拟merge sort。 ...
分类:
其他好文 时间:
2016-09-01 12:28:20
阅读次数:
127
领域驱动设计之领域模型 加一个导航,关于如何设计聚合的详细思考,见这篇文章。 2004年Eric Evans 发表Domain-Driven Design –Tackling Complexity in the Heart of Software (领域驱动设计),简称Evans DDD。领域驱动设 ...
分类:
其他好文 时间:
2016-08-27 19:22:28
阅读次数:
204
题目: 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 fun ...
分类:
其他好文 时间:
2016-08-27 15:26:39
阅读次数:
99
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 ...
分类:
其他好文 时间:
2016-08-25 23:58:26
阅读次数:
342
题目: Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in th ...
分类:
其他好文 时间:
2016-08-23 21:59:08
阅读次数:
123