diff --git a/src/data/roadmaps/datastructures-and-algorithms/content/106-search-algorithms/100-linear-search.md b/src/data/roadmaps/datastructures-and-algorithms/content/106-search-algorithms/100-linear-search.md index ee4465794..374916f6a 100644 --- a/src/data/roadmaps/datastructures-and-algorithms/content/106-search-algorithms/100-linear-search.md +++ b/src/data/roadmaps/datastructures-and-algorithms/content/106-search-algorithms/100-linear-search.md @@ -1,3 +1,8 @@ # Linear Search -Linear search is one of the simplest search algorithms. In this method, every element in an array is checked sequentially starting from the first until a match is found or all elements have been checked. It is also known as sequential search. It works on both sorted and unsorted lists, and does not need any preconditioned list for the operation. However, its efficiency is lesser as compared to other search algorithms since it checks all elements one by one. \ No newline at end of file +Linear search is one of the simplest search algorithms. In this method, every element in an array is checked sequentially starting from the first until a match is found or all elements have been checked. It is also known as sequential search. It works on both sorted and unsorted lists, and does not need any preconditioned list for the operation. However, its efficiency is lesser as compared to other search algorithms since it checks all elements one by one. + +Learn more from the following resources: + +- [@article@DSA Linear Search - W3Schools](https://www.w3schools.com/dsa/dsa_algo_linearsearch.php) +- [@video@Learn Linear Search in 3 minutes](https://www.youtube.com/watch?v=246V51AWwZM) diff --git a/src/data/roadmaps/datastructures-and-algorithms/content/106-search-algorithms/101-binary-search.md b/src/data/roadmaps/datastructures-and-algorithms/content/106-search-algorithms/101-binary-search.md index 37cc7a76c..100e98809 100644 --- a/src/data/roadmaps/datastructures-and-algorithms/content/106-search-algorithms/101-binary-search.md +++ b/src/data/roadmaps/datastructures-and-algorithms/content/106-search-algorithms/101-binary-search.md @@ -1,3 +1,8 @@ # Binary Search -`Binary Search` is a type of search algorithm that follows the divide and conquer strategy. It works on a sorted array by repeatedly dividing the search interval in half. Initially, the search space is the entire array and the target is compared with the middle element of the array. If they are not equal, the half in which the target cannot lie is eliminated and the search continues on the remaining half, again taking the middle element to compare to the target, and repeating this until the target is found. If the search ends with the remaining half being empty, the target is not in the array. Binary Search is log(n) as it cuts down the search space by half each step. \ No newline at end of file +`Binary Search` is a type of search algorithm that follows the divide and conquer strategy. It works on a sorted array by repeatedly dividing the search interval in half. Initially, the search space is the entire array and the target is compared with the middle element of the array. If they are not equal, the half in which the target cannot lie is eliminated and the search continues on the remaining half, again taking the middle element to compare to the target, and repeating this until the target is found. If the search ends with the remaining half being empty, the target is not in the array. Binary Search is log(n) as it cuts down the search space by half each step. + +Learn more from the following resources: + +- [@article@DSA Binary Search - W3Schools](https://www.w3schools.com/dsa/dsa_algo_binarysearch.php) +- [@video@Learn Binary Search in 10 minutes](https://www.youtube.com/watch?v=xrMppTpoqdw)