PLEASE SUBSCRIBE!!!
In the previous lesson ( • Python Programming: Lesson 51 - Selec... ), we talked about selection sort, a third and final sorting algorithm for sorting a SORTABLE collection of elements, whether it be integers or Person objects. In this lesson, we will continue talking about algorithms but will shift focus to searching algorithms. Linear search is very basic but very easy to understand. The goal is to start at the beginning of the list or tuple, iterating through until either we reach the end of the list or tuple (unsuccessful) or until we find the first occurrence of the target element (successful). We can then break out or otherwise stop loop iteration using a boolean.
0:54 Review of Sortable Objects with _lt_
1:22 Review of len(x) and x["key"] Magic Methods
2:34 Review of Lambda Functions without Inputs
3:18 Review of Function Reference Variables
4:25 Review of Sorting Algorithms
5:15 NEW: Intro to Linear Search
12:49 NEW: Linear Search Algorithm in Python
17:27 NEW: Linear Search for Objects by Instance Variable
An equivalent Java lesson regarding linear search is available here: • Java Programming: Lesson 42 - Linear ...
Ok, ready for binary search? A much faster and more efficient searching algorithm is discussed at great length in the next video; stay tuned! • Python Programming: Lesson 53 - Binar...
Thanks for watching, and PLEASE SUBSCRIBE!!!