





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An explanation of the binary search algorithm, which is used to find the index of a specific value in a sorted array. The algorithm maintains the invariant that the value to be found is between the first and last elements of the array, and repeatedly divides the search interval in half. The process continues until the value is found or the interval is empty.
Typology: Slides
1 / 9
This page cannot be seen from the preview
Don't miss anything!






lo
hi
lo^60 131 142253 334 435 516 mid^537 648729 84109311 9512 961397 hi^14
lo^60 131 142 mid^253 334 435 51 hi^6537 648729 84109311 9512
(^60131 142253 33) lo (^4 435 51) hi 6 537 648 729 8410 9311 9512 9613 9714
(^60131 142253 33) lo 4 435 516 537 648 729 8410 9311 9512 9613 9714 hi
(^60131 142253 33) lo 4 435 516 537 648 729 8410 9311 9512 9613 9714 midhi