Dale - Computer Science Illuminated 322

Dale - Computer Science Illuminated 322 - 9.5 Binary Search...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sequential search Looking for an item from the beginning of the list 9.5 Binary Search 295 Figure 9.13 Splitting algorithm 92 061 0 (a) Initialization 14 8 60 11 Rx>7 CzR,8xCz R7>O Cz 0 (b) Increment left unitl list [left] > splitVal or left > right. 14 8 60 11 Rx>7 CzR,8xCz R7>O Cz 0 (c) Decrement right until list[right] <= splitVal or left > right. 14 8 60 11 Rx>7 CzR,8xCz R7>O Cz 9861 0 (d) Swap list[left] and list[right]; move left and right toward each other. 14 20 60 11 Rx>7 Cz R,8xCz R7>O Cz 0 (d) Increment left until list[left] > splitVal or left > right. Decrement right until list[right] <= splitVal or left > right. 14 20 60 11 Rx>7 Cz R,8xCz R7>O Cz 6891
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/13/2011 for the course CSE 1550 taught by Professor Marianakant during the Fall '10 term at York University.

Ask a homework question - tutors are online