Book Notes
5.1 Flavors of Graphs
 Undirected vs. Directed
 Weighted vs. Unweighted
 Simple vs. Nonsimple
 Sparse vs. Dense
 Cyclic vs. Acyclic
 Embedded vs. Topological
 Implicit vs. Explicit
 Labeled vs. Unlabeled
Problem: Given an arraybased heap on n elements and a real number x, efficiently determine whether the kth smallest element in the heap is greater than or equal to x. Your algorithm should be O(k) in the worstcase, independent of the size of the heap. Hint: you do not have to find the kth smallest element; you need only determine its relationship to x.
Solution: There are at least two different ideas that lead to correct but inefficient algorithms for this problem:
An O(k) solution can look at only k elements smaller than x, plus at most O(k) elements greater than x. Consider the following recursive procedure, called at the root with i= 1 with count=k:
Effective C++ 系列的作者 Scott Meyers 在 Dconf 中 The Last Thing D Needs 聊了些 C++的特性，稍微总结一下。
1 2 3 4 5 6 7 8 9 10 11 

Our two most important tools are (1) the RAM model of computation and (2) the asymptotic analysis of worstcase complexity.
全书分为 3 部分：
书本和习题大部分代码实现。
给出数组中找出连续子数组最大和。