Learn Linear Search in 3 minutes ⬇️

preview_player
Показать описание
Linear search data structures and algorithms tutorial example explained

#linear #search #java
Рекомендации по теме
Комментарии
Автор

public class Main{

public static void main(String args[]){

// linear search = Iterate through a collection one element at a time

int[] array = {9, 1, 8, 2, 7, 3, 6, 4, 5};

int index = linearSearch(array, 5);

if(index != -1) {
System.out.println("Element found at index: " + index);
}
else {
System.out.println("Element not found");
}

}

private static int linearSearch(int[] array, int value) {

for(int i = 0; i < array.length; i++) {
if(array[i] == value) {
return i;
}
}

return -1;
}
}

BroCodez
Автор

bro just casually explained my whole 1 hour class lmao

shyreal
Автор

I am going through Cyber security school currently. The texts are very long and complicated in a reading format, yet here you are teacher better than my text books. Thank you, you've helped me understand and grasp a lot this last year.

calvinneill
Автор

Didn't you just post this poll like two days ago? you really are one of the best coding tutorial channels out there man, keep it up.

realnzone
Автор

POV my goal is to have a little heart from Bro code.
POV is not a POV.

ermesmargjeka
Автор

Love your series, very concise and clear!

CoffeeXmusic
Автор

As always clear and easy to follow tutorial on something that will be very useful.
Thanks Bro. 👍👍

FukSN
Автор

Randomly encountered this channel some time ago, got hooked to the hour vids

and now discovered that bro also does DSA...

now cramming for a tech interview

jevardspproxyacct
Автор

Man that Gigachad icon truely sets for you.

jenkar
Автор

Thank you so much 💓
صلوا على رسول الله ❤

hope_
Автор

Its a very informative video, great job.

kunwardeepsingh
Автор

Do u know what kind of search algo is used by big websites like youtube, facebook, twitter etc???
Thanks for the videos btw, I have definitely learnt alot!

sadasasdas
Автор

Very nice tutorial as always!!! Is there any way to see if there another index with the same value?

kaiiemsawat
Автор

Dude that "small to medium data set", do we have like a specific range of how many data is that? Thanks.

wzup
Автор

Lol you just liked my comment for more java algorithms and data structures and you posted this video😍🥰

velk
Автор

So... your one weird trick is being actually good at coding and great at teaching🤔😂😂 Love your content Bro💪

felixnyamongo
Автор

Please don't remove the commented theory Bro. I need that too. Love from India.😁

meiyappanamirthalingam
Автор

Bro we could also make it such that the user can input the value to be found and then use the same code
But i felt that we could just use import java.util.*;

Anshuman_Chaudhary
Автор

what would be the title of that problem code?

paulvincentdesamparado
Автор

0:42 what does it mean data structures without random access?

malvernmabvira