Linear Search Algorithm in Data Structures | C++ Program to Implement Linear Search Algorithm

preview_player
Показать описание
In computer science, a linear search or sequential search is a method for finding an element within a list. It sequentially checks each element of the list until a match is found or the whole list has been searched.
A simple approach is to do linear search, i.e
1. Start from the leftmost element of arr[] and one by one compare x with each element of arr[]
2. If x matches with an element, return the index.
3. If x doesn’t match with any of elements, return -1.
We will be implementing linear search program in C++ Programming Language.
---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
Support Simple Snippets by Donations -
---------------------------------------------------------------------------------------------
Simple Snippets Official Website -
Simple Snippets on Facebook -
Simple Snippets on Instagram -
Simple Snippets on Twitter -
Simple Snippets Google Plus Page -
Simple Snippets email ID -

#linearsearch #searchingalgorithms #datastructures #sequentialsearch #algorithms
Рекомендации по теме
Комментарии
Автор

Hey Guys, if you want more such tech educational videos on this channel then please support me by subscribing to this channel & also share it with your friends as it helps me create more content just for you ✌

SimpleSnippets
Автор

Why this video have so less likes?? It was the best explanation for linear search so far! keep going bro, because of you I understood this concept quite well. Looking forward for your upcoming videos.

charugupta
Автор

Thanks.
you help me to study for my final exam.
pray for meto pass it.

zoay
Автор

I am an Egyptian student. Your explanation is very nice. Thank you for providing this information

mohammednassf
Автор

best channel for DSA with art explanation

Lalinxdboom
Автор

Your explaination is crystal clear and to point. I understood the concept very well.
I request to make a video on fibonacci search too.

Shailswap
Автор

Excellent teaching, I always follow your videos, looking forward for your upcoming videos.

vaibhavchafle
Автор

Happy that someone recommended this channel in comment box. Very helpful.

bikramchettri
Автор

Yet I didn't gone through this video. But then also I complimented because your videos, as expected are excellent.

jayeshyedge
Автор

I was about to comment add break once found element and see you have already shown that :)

One more suggestion is that you could have used flag = 0 (initial) and then once found set flag = 1 and break out of the loop. So that explanation of your temp variable could be easier.

I have one doubt regarding all searching algorithms though...What if we have duplicates?

yashsonawane
Автор

Why are you not using break statement in if(....) Loop when we got our condition!!

manikanth.
Автор

You didn't explain why temp is there?

umerkhan
Автор

bro, thanks for the upload. lesson missed a lot, wil be back .keep it up, we are following you

sudheerm.s
Автор

Really a very good video. Thanks a lot!!

jayeshyedge
Автор

what is linear soart ....iam confuse.. give ans and what is difference in seqvential and selection soart

RealRaze
Автор

This was very helpful for me, Thank you so much ☺️

shamaleejayakodi
Автор

sir this program is not run in the code block properly plz suggest me sir

rohitpandey
Автор

Will it be okay to start this topic before linked list ?. Becouz as a beginner I am finding linked list hard.

saniyamansuri
Автор

Doesnt Linear Search have complexity O(n) ? What is the time complexity for the dividing array search?

ThatLLMGuy
Автор

nice video! what if there are multiple occurrences of a number?

mhassankhan
join shbcf.ru