filmov
tv
Linear Search: Iterative and Recursive in 5 Minutes

Показать описание
In this video, I will explain linear search by demonstrating the algorithm in a program iteratively (using a for loop) and then recursively (using recursion).
The way linear search works is that you have a number that you want to search for in an array or a list. If it exists in the array, you return the location (which is the index) where that number occurs. We call this number "the target". If the target does not exist inside the array, you simply return -1.
What is recursion? Recursion is a function that calls upon itself. Here, we write a function that calls upon itself to linear search an element or value inside an array using a for loop and using recursion. While it is easy to use a for loop or while loop to do this, it is important that you understand these recursion steps to have a strong foundation to learn more complex recursive algorithm in the future.
In the next video, I will explain binary search which is very similar to linear search, and I will also explain why it is so useful.
LIKE & SUBSCRIBE:
The way linear search works is that you have a number that you want to search for in an array or a list. If it exists in the array, you return the location (which is the index) where that number occurs. We call this number "the target". If the target does not exist inside the array, you simply return -1.
What is recursion? Recursion is a function that calls upon itself. Here, we write a function that calls upon itself to linear search an element or value inside an array using a for loop and using recursion. While it is easy to use a for loop or while loop to do this, it is important that you understand these recursion steps to have a strong foundation to learn more complex recursive algorithm in the future.
In the next video, I will explain binary search which is very similar to linear search, and I will also explain why it is so useful.
LIKE & SUBSCRIBE:
Linear Search: Iterative and Recursive in 5 Minutes
Linear Search Algorithm with Code & Complexity (Iterative & Recursive) | GATECSE | Data Str...
Linear search vs Binary search
2.6.1 Binary Search Iterative Method
2.6.2 Binary Search Recursive Method
7.1 Linear Search Algorithm | Linear Search in C | Data Structures Tutorials
Linear Search (iterative and recursive methods)
Binary Search Algorithm in 100 Seconds
Recursive Linear Search Algorithm | Algorithms
Linear Search using Python | Python Tutorial for Beginners 68
Learn Binary Search in 10 minutes 🪓
Binary Search in C++ and Java | Recursively and Iteratively | DSA-One Course #22 | Anuj Bhaiya
Linear Search using Recursion
Recursive program to linearly search an element in a given array | GeeksforGeeks
#030 [Data Structures] - Linear Search (Sequential Search) With Implementation
Learn Linear Search in 3 minutes ⬇️
Recursive Linear Search | Code Tutorial
8. Recursive Linear Search to find a key in the array elements.
BS-1. Binary Search Introduction | Real Life Example | Iterative | Recursive | Overflow Cases
02 Binary Search - Iterative and recursive method
Binary Search -Iterative and Recursive Method
19.3 Recursion - Linear Search
1.11 Best Worst and Average Case Analysis
Linear Search using Recursion
Комментарии