Interpolation search. Similar to ordinary binary search, but linear interpolation between the interval endpoints is
used to guess the correct position, rather than simply looking at the middle element. The worst-case running time is
still Q(lg n), but the average-case running time is O(lg lg n) for uniformly distributed data. (Mentioned in the “If You’re
Curious …” section of Chapter 6.)
Iterative deepening DFS. Repeated runs of DFS, where each run has a limit to how far it can traverse. For structures
with some fanout, the running time will be the same as for DFS or BFS (that is, Q(n+m)). The point is that it has the
advantages of BFS (it finds shortest paths and explores large state spaces conservatively), with the smaller memory
footprint of DFS. (See Listing 5-8.)
Do'stlaringiz bilan baham: |