Learn Linear Search in 3 minutes ⬇️

94,939
0
Published 2021-10-16
Linear search data structures and algorithms tutorial example explained

#linear #search #java

All Comments (21)
  • @BroCodez
    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; } }
  • @shy4real
    bro just casually explained my whole 1 hour class lmao
  • 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.
  • @realn8zone
    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.
  • @FukSN
    As always clear and easy to follow tutorial on something that will be very useful. Thanks Bro. 👍👍
  • Randomly encountered this channel some time ago , got hooked to the some-programming-language-in-an hour vids and now discovered that bro also does DSA... now cramming for a tech interview
  • @kaiiemsawat3859
    Very nice tutorial as always!!! Is there any way to see if there another index with the same value?
  • POV my goal is to have a little heart from Bro code. POV is not a POV.
  • @jenkar5716
    Man that Gigachad icon truely sets for you.
  • @hope50_78
    Thank you so much 💓 صلوا على رسول الله ❤
  • @sadasasdas8467
    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!
  • @velk20
    Lol you just liked my comment for more java algorithms and data structures and you posted this video😍🥰