| | | | | |

Tracing Specific Binary Search Algorithms

Here is a trace the call lower_bound(h) on a specific vector:

     dghhkksy
     --------
         m
     dghhkksy
     ----
       m
     dghhkksy
     --
      m
     dghhkksy
       ^lb

More traces of both lower_bound() and upper_bound() are given in the narrative. The executable binarySearchTrace.x is available for experimentation in area51 of the course library.


| | Top of Page | 3. Introduction to Algorithm Analysis - 9 of 23