Java Programming: Lesson 43 - Binary Search
PLEASE SUBSCRIBE!!! In the previous lesson (https://youtu.be/4Hca7dzuWHg), we learned about a way to search an array or list for an element. This lesson gives us a much more efficient way to search for an element, provided that the list is sorted. It repeatedly divides a sorted array or ArrayList into two pieces to consider, kind of like looking for the definition of a word in a dictionary where all the words are sorted alphabetically. Much easier than linear search, "apple", "banana", "bat", ... how many words are there in English??? 1:14 Review of Linear Search with ints 3:11 Review of Linear Search with Objects 5:04 NEW: Intro to Binary Search 8:29 NEW: Binary Search Algorithm for doubles 14:43 NEW: Example of Binary Search An equivalent version of this lesson in the Python programming language is available here: Next video is on exceptions, a neat topic for handling code that would otherwise cause runtime errors: https://youtu.be/od2tYNCqhVo Thanks for watching, and PLEASE SUBSCRIBE!!!
PLEASE SUBSCRIBE!!! In the previous lesson (https://youtu.be/4Hca7dzuWHg), we learned about a way to search an array or list for an element. This lesson gives us a much more efficient way to search for an element, provided that the list is sorted. It repeatedly divides a sorted array or ArrayList into two pieces to consider, kind of like looking for the definition of a word in a dictionary where all the words are sorted alphabetically. Much easier than linear search, "apple", "banana", "bat", ... how many words are there in English??? 1:14 Review of Linear Search with ints 3:11 Review of Linear Search with Objects 5:04 NEW: Intro to Binary Search 8:29 NEW: Binary Search Algorithm for doubles 14:43 NEW: Example of Binary Search An equivalent version of this lesson in the Python programming language is available here: Next video is on exceptions, a neat topic for handling code that would otherwise cause runtime errors: https://youtu.be/od2tYNCqhVo Thanks for watching, and PLEASE SUBSCRIBE!!!