12.1 Find the mistake(s) in the following code:unsigned int i;for (i = 190; i >= 0; --i)printf("%d\n", i);这道题让我们找出给定的简短的程序的错误,这里共有两处错误:1. 无符号整型永远大于0,所...
分类:
其他好文 时间:
2015-10-23 07:52:46
阅读次数:
165
11.8 Imagine you are reading in a stream of integers. Periodically, you wish to be able to look up the rank of a number x (the number of values less t...
分类:
其他好文 时间:
2015-10-22 12:23:25
阅读次数:
246
11.4 Imagine you have a 20 GB file with one string per line. Explain how you would sort the file.这道题说给了我们一个20GB大小的文件,每行有一个字符串,让我们给文件内容排序。那么既然强调了这么大的一个...
分类:
编程语言 时间:
2015-10-16 11:50:12
阅读次数:
155
11.3 Given a sorted array of n integers that has been rotated an unknown number of times, write code to find an element in the array. You may assume t...
分类:
其他好文 时间:
2015-10-16 11:38:27
阅读次数:
166
11.1 You are given two sorted arrays, A and B, where A has a large enough buffer at the end to hold B. Write a method to merge B into A in sorted orde...
分类:
编程语言 时间:
2015-10-15 00:57:50
阅读次数:
139
1.Implement an algorithm to determine if a string has all unique characters What if you can not use additional data structures? The length of ACSII co...
分类:
其他好文 时间:
2015-10-14 21:34:34
阅读次数:
145
10.7 Imagine a web server for a simplified search engine. This system has 100 machines to respond to search queries, which may then call out using pro...
分类:
其他好文 时间:
2015-10-13 13:48:00
阅读次数:
224
10.6 You have 10 billion URLs. How do you detect the duplicate documents? In this case, assume that "duplicate" means that the URLs are identical.这道题让...
分类:
Web程序 时间:
2015-10-10 06:49:43
阅读次数:
193
10.5 If you were designing a web crawler, how would you avoid getting into infinite loops?这道题问如果让我们设计一个网络爬虫,怎么样才能避免进入无限循环。那么何谓无限循环呢,如果我们将网络看做一个图Graph,...
分类:
Web程序 时间:
2015-10-09 00:34:16
阅读次数:
245
10.2 How would you design the data structures for a very large social network like Facebook or Linkedln? Describe how you would design an algorithm to...
分类:
Web程序 时间:
2015-10-03 13:11:03
阅读次数:
229