C++ Programming: Linear Search Algorithm

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ก.ย. 2024

ความคิดเห็น • 91

  • @mostafamohamed717
    @mostafamohamed717 7 ปีที่แล้ว +138

    finally, a voice over that's not Indian

    • @davidnovosardian6848
      @davidnovosardian6848 7 ปีที่แล้ว +11

      i like indian accent better

    • @TheWarfare07
      @TheWarfare07 7 ปีที่แล้ว +19

      fuck indian accent.

    • @Wooah1
      @Wooah1 6 ปีที่แล้ว +8

      Seriously, I can't stand getting an indian accent on a programming video, even if it's the most reliable and best info being given, I'll still pass.

    • @fabiboiii
      @fabiboiii 6 ปีที่แล้ว +2

      Ikr, it sounds so mean but at the end of the day you have to choose videos you can actually follow and understand

    • @GStar1
      @GStar1 6 ปีที่แล้ว +2

      Lol guys I'm Indian. But ya I'm fed up too with those videos. But they are legit at least.

  • @ReelLearning
    @ReelLearning  12 ปีที่แล้ว +12

    Thanks! Keep watching.

  • @varinderbrar9843
    @varinderbrar9843 8 ปีที่แล้ว +4

    You do a very well job brother of explaining the concept, keep it up!!!

  • @youssofprogrammer7546
    @youssofprogrammer7546 2 ปีที่แล้ว +1

    thanks very much I love your videos

  • @victoriadathan2675
    @victoriadathan2675 3 ปีที่แล้ว +2

    Thanks so much! This helped me understand linear search more clearly via code. Currently learning data structures & algorithms for potential jobs. C++ is my go-to language; it really helps me think.

  • @Handleme23
    @Handleme23 6 ปีที่แล้ว +4

    What if you didn’t know what was gonna be in the array, how you initialize it

    • @frankymaca
      @frankymaca 5 ปีที่แล้ว +1

      you use a vector, and every variable that you get you do push_back for inserting it in the vector

  • @terryalleyne8455
    @terryalleyne8455 4 ปีที่แล้ว +1

    H,i how could you construct a program to perform a linear search for a string within another string not using the find function. all of the examples use int which is fairly easy.

    • @adeniyiladenegan7450
      @adeniyiladenegan7450 2 ปีที่แล้ว

      Hi I am really searching for this and I hope to see it someday soon.
      what if I have to enter a few characters and the search returns all similar texts or sentences in a stored array
      Please Terry if you find it, do let me know here, I will be on the lookout.

  • @yasina63
    @yasina63 2 ปีที่แล้ว +1

    Wow, your teaching style is a piece of cake.
    Thanks for watching from Ethiopia.

  • @balfaboy
    @balfaboy 11 ปีที่แล้ว +3

    Great tutorials ! Thank you so much for aharing the knowledge and great manner of actually "teaching" the subject matter.

  • @johnnyverse257
    @johnnyverse257 3 ปีที่แล้ว

    #include
    #include
    using namespace std;
    int main()
    {
    int access = 0, searchnum, arr = 6, num, answer;
    int nums[] = {4, 8, 15, 16, 23, 42};
    cout searchnum;
    for(int i = 0; i < arr; i++){
    num = nums[access];
    if(nums[i] == searchnum){
    answer = i+1;
    }
    }if(answer

  • @nouraaliabuhlega4023
    @nouraaliabuhlega4023 6 ปีที่แล้ว +2

    god i love it ,, thank god not indian

  • @user-nk2jk1bp6j
    @user-nk2jk1bp6j 5 ปีที่แล้ว +1

    How would you do a multi-dimensional array search?

  • @Tnguy830
    @Tnguy830 4 ปีที่แล้ว +1

    You explain better than my professor

  • @AhmedAlbadwi
    @AhmedAlbadwi 12 ปีที่แล้ว +1

    thank you very much
    the way you explain things is simple and very helpful

  • @Persian771
    @Persian771 9 ปีที่แล้ว +1

    he thanks for your videos.could you make a video about the Big O notation and complexity. I really don't understand what they mean and how I can use it.

    • @fahadmirza8
      @fahadmirza8 9 ปีที่แล้ว

      +Persian771 : Check Derek Banas's video abt Big O Notations

  • @soma78_
    @soma78_ 7 หลายเดือนก่อน

    Thanks your explaination simple and easy ❤

  • @samanawais4353
    @samanawais4353 4 ปีที่แล้ว +1

    Search engine p project bna dein plz

  • @ravadirajkumar477
    @ravadirajkumar477 3 ปีที่แล้ว

    Thank you so much...................................

  • @alexandre83582
    @alexandre83582 11 ปีที่แล้ว +1

    Very helpful! Thank you. One thought. In determining if the number was found or not, you used if (results > 0). This would only work if the array was unsigned int. If the array consisted of negative numbers, it wouldn't work. so wouldn't it be necessary to declare the array appropriate? I guess in the case, you can check if the result !==-1, return "Number was found."

  • @wongyuenzeng
    @wongyuenzeng 12 ปีที่แล้ว +1

    You're very clear with what you're saying and doing :D Thankyou!

  • @sajmon9490
    @sajmon9490 4 ปีที่แล้ว +1

    thanks bruh

  • @bermudatriangle94
    @bermudatriangle94 4 ปีที่แล้ว +1

    dude u nailed it!

  • @varinderbrar9843
    @varinderbrar9843 8 ปีที่แล้ว +5

    You do a very well job brother of explaining the concept, keep it up!!!

  • @badrelkholy8036
    @badrelkholy8036 ปีที่แล้ว

    Seems like I'm a bit late

  • @dylanrichardson596
    @dylanrichardson596 5 ปีที่แล้ว

    Does anyone know how to search a .txt file using a linear search??????????????

  • @lelouchiha5089
    @lelouchiha5089 ปีที่แล้ว

    Thank you so much

  • @najlahanani659
    @najlahanani659 3 ปีที่แล้ว

    Why i got errors

  • @ronaldismyname
    @ronaldismyname 5 ปีที่แล้ว

    You shouldn't have to pass in the size of the array as an input parameter,, you can calculate that in the function.

  • @MdAshik-li6jc
    @MdAshik-li6jc 8 ปีที่แล้ว +1

    very nice tutorial

  • @امینجمالی-خ9ص
    @امینجمالی-خ9ص 3 ปีที่แล้ว

    Thank you

  • @attymathodie7054
    @attymathodie7054 6 ปีที่แล้ว +1

    wow.. I like this song..

  • @kevinzhu4570
    @kevinzhu4570 7 ปีที่แล้ว

    Have a question, why "size" doesn't need to declare first in somewhere before you put it in the function?

  • @xadekpl
    @xadekpl 11 ปีที่แล้ว

    Videos are great ;)) .... But iam wondering how long will it take for a modern pc to loop through an array[1000000] using a linear search to find a specific number .. ??? Any idea ?? ... Is there any way to calculate time that linear searches will take ??

  • @rsdntevl
    @rsdntevl 7 ปีที่แล้ว +1

    better than paid udemy courses

  • @VincePlaysChess
    @VincePlaysChess 5 ปีที่แล้ว

    very nice video. clear and easy to follow. Thank you!

  • @haxor2ez842
    @haxor2ez842 4 ปีที่แล้ว

    Clear,Precise and perfect ;)
    Will watch your other videos as well

  • @kunz3986
    @kunz3986 8 ปีที่แล้ว +1

    How can i do this with strings instead of numbers

    • @psohn420
      @psohn420 8 ปีที่แล้ว +1

      string instead of int, getline cin.

    • @opgg736
      @opgg736 7 ปีที่แล้ว +1

      still need that code?

    • @edilsongiachini5847
      @edilsongiachini5847 6 ปีที่แล้ว +1

      use templates or standard library #include

  • @anthonystevens6999
    @anthonystevens6999 3 ปีที่แล้ว

    Best video about this topic! thanks :)

  • @mwezi10
    @mwezi10 4 ปีที่แล้ว

    This is good stuff by ReelLearning

  • @cookiesandcode5642
    @cookiesandcode5642 2 ปีที่แล้ว

    gg

  • @Dog696911
    @Dog696911 12 ปีที่แล้ว +1

    More please, I love these.

  • @EduardoKicks
    @EduardoKicks 9 ปีที่แล้ว +1

    how do i search an array with random numbers

    • @fahadmirza8
      @fahadmirza8 9 ปีที่แล้ว +1

      +KoolKid : Isn't he doing that already? Looking for a number in a array which doesn't have any order. Unless you meant something else?

    • @EduardoKicks
      @EduardoKicks 9 ปีที่แล้ว +2

      Fahad Mirza i figgured it out and yea, but i made an array with random values in it. now im trying to figure out instead of -1, it returns the index of the value closest to the value. So lets say there is a random value of 54 in the array, and it is in the 3rd index, the user searches for 53 and it will return the closest value in the array to 53.

    • @EduardoKicks
      @EduardoKicks 9 ปีที่แล้ว

      Fahad Mirza if you know how to please help.

    • @fahadmirza8
      @fahadmirza8 9 ปีที่แล้ว +1

      +KoolKid: here is your code:
      #include
      #include
      using namespace std;
      int main()
      {
      int array[10] = {11,51,17,21,14,31,16,91,10,81};
      int userValue;
      int index;
      int distance;
      cout > userValue;
      for(int i=0; i

  • @saramillett206
    @saramillett206 4 ปีที่แล้ว

    I must thank you for the great explanation you did in this video. Thank you so much.

  • @matusaldebebe5072
    @matusaldebebe5072 8 ปีที่แล้ว

    it is good explanation thank you very much and make linked list aligorthms just like this

  • @_unknown7_
    @_unknown7_ 6 ปีที่แล้ว

    Thank you very much The same program was written in a complex manner in my textbook but you have made it
    pretty easier for me

  • @komronvalijonov3485
    @komronvalijonov3485 4 ปีที่แล้ว

    Thanks a lot ! The clearest explanation ever found.

  • @balfaboy
    @balfaboy 11 ปีที่แล้ว

    Hi X,
    Seek out big-O notation...I believe the function 0(N) will get you going in the right direction...the algorithm grows linearly in direct proportion to the size of the data set. You can take a multiple of your set size, say 10, and test the speed of that, then figure the multiple of [1000000] and the big-O funtction definitions should help you determine the actual speed.

  • @smokestrong1000
    @smokestrong1000 6 ปีที่แล้ว

    i'll spend all day trying to figure this stuff out in my book. I look watched this and no confusion got it instantly. Thank you

  • @Gagan_salwan
    @Gagan_salwan 5 ปีที่แล้ว

    6:34 is the time when you should stop watching or everything he say will go over your head

    • @marktate2683
      @marktate2683 4 ปีที่แล้ว

      Then how will you know how to apply the source code -_- gotta learn more than just the explanation of how it works in order to be a functional programmer.

  • @ilifahmeeda1459
    @ilifahmeeda1459 11 ปีที่แล้ว

    thank you very much, this coding really helped me a lot through out my assignment.with clear explanation. keep it up

  • @Il0vestage
    @Il0vestage 12 ปีที่แล้ว

    Thanks for making linear search easier for understanding :D keep up the good work ^^

  • @carlalendor4150
    @carlalendor4150 10 ปีที่แล้ว

    Great video, clarity in explanation and design,,,,

  • @siammureed2391
    @siammureed2391 6 ปีที่แล้ว

    how we make and call a function .

  • @alfredcalleja450
    @alfredcalleja450 7 ปีที่แล้ว

    Brilliant! Thanks very much.

  • @worldonawrist
    @worldonawrist 7 ปีที่แล้ว

    Easy to follow and neatly presented. Thanks!

  • @MoffGaming
    @MoffGaming 9 ปีที่แล้ว

    Excellent.
    Thank you.

  • @hadeelalqatabri7546
    @hadeelalqatabri7546 7 ปีที่แล้ว

    thank u so much ..awesome

  • @muhammadfarooq6924
    @muhammadfarooq6924 10 ปีที่แล้ว

    u r awesome

  • @muhammadafzaalkhan9277
    @muhammadafzaalkhan9277 6 ปีที่แล้ว

    great

  • @abhishekverma9999
    @abhishekverma9999 11 ปีที่แล้ว

    thank you very much sir :)

  • @heshammostafa3446
    @heshammostafa3446 10 ปีที่แล้ว

    (Y) (Y)

  • @pournimathakare2279
    @pournimathakare2279 6 ปีที่แล้ว

    is this coding valid for turbo c++

  • @edilsongiachini5847
    @edilsongiachini5847 6 ปีที่แล้ว

    it's very good but it can be more compact and fast.