Here we have started Data Structures Complete Course. In this course ,We will try our best to delivery knowledge to you guys. If you like our videos then subscribe our channel and also share it with your friends and fellows.
Kacs Learnings - website](https://kacslearnings.com/)
or any queries, feel free to reach out to us:
Connect with us on LinkedIn:
[Zeeshan Ilyas - LinkedIn]( / zeeshan-ilyas-61792913a )
Connect with us on Facebook:
[Kacs Learnings - Facebook]( / kacslearnings )
Connect with us on Instagram:
[Kacs Learnings - Instagram](https://www.instagram.com/kacslearnin...)
Connect with us on TikTok:
[Kacs Learnings - TikTok](https://www.tiktok.com/@kacs_learning...)
Here is the Detail of Lecture :
Two popular search methods are Linear Search and Binary Search. So, here we will discuss the popular searching technique, i.e., Linear Search Algorithm.
Linear search is also called as sequential search algorithm. It is the simplest searching algorithm. In Linear search, we simply traverse the list completely and match each element of the list with the item whose location is to be found. If the match is found, then the location of the item is returned; otherwise, the algorithm returns NULL.
Steps used in the implementation of Linear Search
First, we have to traverse the array elements using a for loop.
In each iteration of for loop, compare the search element with the current array element, and -
If the element matches, then return the index of the corresponding array element.
If the element does not match, then move to the next element.
If there is no match or the search element is not present in the given array, return -1.
Time Complexity
Best Case Complexity - In Linear search, best case occurs when the element we are finding is at the first position of the array. The best-case time complexity of linear search is O(1).
Average Case Complexity - The average case time complexity of linear search is O(n).
Worst Case Complexity - In Linear search, the worst case occurs when the element we are looking is present at the end of the array. The worst-case in linear search could be when the target element is not present in the given array, and we have to traverse the entire array. The worst-case time complexity of linear search is O(n).
#datastructures
#datastructuresandalgorithms
#binary
#binarysearchtree
#binarysearch
#data
#sortingalgorithm
#searching
#searchingAlgorithm
#datastructure
#datastructureandalgorithm
#datastructureinhindi
#linearsearch
In the case of any queries Contact us at:
Email us:
[email protected]
Like us on Facebook:
Link: / thekacsacademy
Follow us on Twitter:
Link : / zeeshan99237099
Instagram :
Link : / thekacs6
#Subscribe #DataStructures #SearchingTechniques