Searching is one of the most common things we ask a program to do: given a collection of data, find whether a particular value is present and, if so, where. In this topic we look at two classic approaches. Linear search walks through a list one element at a time and compares each item to the target; it works on any array, sorted or not. Binary search repeatedly cuts a sorted array in half, discarding the portion that cannot contain the target, which makes it dramatically faster but adds the requirement that the data already be in order.
These algorithms matter in this course for two reasons. First, they are the simplest realistic setting for reasoning about Big O: linear search is O(n), binary search is O(log n), and you can see exactly why by counting comparisons. Second, they force you to think about trade-offs. Binary search is faster per lookup, but if the data is unsorted you must pay the cost of sorting first, so the "better" algorithm depends on the scenario.
As you watch the videos below, pay attention to three things: the preconditions each algorithm requires, the exact loop structure and index arithmetic (especially the low, high, and mid pointers in binary search, and how the boundaries are updated), and the comparison counts the presenters use to justify the running time. The videos use pseudocode and Python, so after watching, practice rewriting each algorithm in JavaScript using a while or for loop over an array, and test it on arrays where the target is first, last, in the middle, and absent entirely.
A fast, focused explanation of binary search: how the algorithm maintains a search range, checks the middle element, and discards half the array on each step. The description links to a code implementation on GitHub, so the walkthrough is tied to actual working code. In four minutes it should cover the sorted-array requirement and the logarithmic running time.
Michael Sambol's algorithm videos are widely used for their accuracy and economy, making this an efficient reference for the Binary Search subtopic and an easy one to rewatch while you translate the logic into JavaScript.
A lecture-style walkthrough of linear search as a data structures topic, stepping through how the algorithm scans an array element by element until it finds the target or reaches the end. Based on the title, it also covers the time complexity of linear search, which should include the best, average, and worst cases. The pace is slower and more instructional than a quick summary video, so expect worked examples on the board.
Gate Smashers is a well-known computer science teaching channel, and this video pairs the mechanics of linear search with its complexity analysis, which directly supports the "What Is a Searching Algorithm?" and "Linear Search" subtopics.
Part of a beginner-oriented series on basic algorithms, this video walks through binary search as an example of the divide-and-conquer strategy, explaining how the algorithm repeatedly splits the data set. At nearly eight minutes it has room for a slower trace of the steps than a summary video allows. Expect emphasis on the conceptual idea of halving the problem as well as the procedure itself.
It reinforces binary search from a coding-fundamentals perspective and frames it as divide-and-conquer, which is useful background when you compare binary search against linear search and explain why the two have different growth rates.
Together these videos give you the step-by-step procedures you need to implement searching manually in JavaScript (MO1), and the contrast between the linear search lecture and the two binary search explanations lets you compare requirements, procedures, and appropriate use cases side by side (MO2). Both the linear search lecture's complexity discussion and the binary search videos' halving argument build the reasoning behind O(n) versus O(log n) (MO3), which in turn is what you use to decide whether sorting first and searching with binary search is worth it for a given data set and access pattern (MO4). Use the videos for the algorithms and analysis, then rely on the module's code examples and practice work for the JavaScript implementations and traversal techniques (MO5).
These videos were chosen from YouTube on October 2, 2026. Each has captions; the player turns them on. Videos on YouTube can be changed or removed — if one no longer plays, tell your instructor. If a player does not appear, use its Watch on YouTube link.