Bidirectional Dijkstra. Dijkstra’s algorithm run from start and end node simultaneous, with alternating iterations going
to each of the two algorithms. The shortest path is found when the two meet up in the middle (although some care must
be taken at this point). The worst-case running time is just like for Dijkstra’s algorithm. (See Listings 9-8 and 9-9.)
Binary search trees. A binary tree structure where each node has a key (and usually an associated value).
Descendant keys are partitioned by the node key: Smaller keys go in the left subtree, and greater keys go in the right.
On the average, the depth of any node is logarithmic, giving an expected insertion and search time of Q(lg n). Without
extra balancing, though (such as in the AA-tree), the tree can become unbalanced, giving linear running times.
(See Listing 6-2.)
Do'stlaringiz bilan baham: |