Interpolation Search algorithm (with Example & CODE)

Поділитися
Вставка
  • Опубліковано 15 гру 2024

КОМЕНТАРІ • 78

  • @rahulchaubey8988
    @rahulchaubey8988 4 роки тому +10

    If i find your vdo on any topic then i got sure i m going to understand this concept.

  • @uubaidullah
    @uubaidullah 4 роки тому +4

    Bro, you described it very well .I tried to search regarding this algorithm and i was scared by the jargon but we make it real smooth,hats off.

  • @chimeremanaege785
    @chimeremanaege785 3 роки тому +2

    Enjoyed your lecture ❤️. Thanks a lot. I will be writing my exams in 2 hours. Wish me success 🙏

  • @jonayethossain7645
    @jonayethossain7645 4 роки тому +5

    This tutorial really helpful for computer science and engineering students..

  • @krupapatel4623
    @krupapatel4623 2 роки тому +2

    Very nice video and explanation thank you so much

  • @RohitKumar-my6wf
    @RohitKumar-my6wf 2 роки тому

    Yrr mast padhato ho yrr sb doubt clear ho jaata h❤️❤️

  • @soulvocals3474
    @soulvocals3474 4 роки тому +2

    Basically it all depends upon the formula..nice explanation..👍

  • @connorwilliams1647
    @connorwilliams1647 4 роки тому +10

    Great delivery and explanation, but I'd love if you got some type of writing pad for future videos. Was difficult to read. Ty tho

    • @techdose4u
      @techdose4u  4 роки тому +1

      My handwritting is bad 😅

  • @sudiptaghosh6362
    @sudiptaghosh6362 3 роки тому +1

    Dada Tum Bariya Kam Kar Rahe Ho !!!! ❤❤❤❤

  • @voytko1994
    @voytko1994 2 роки тому

    Thanks, bro! Greatest explanation Ive ever heard!

  • @dgomezperry
    @dgomezperry 4 роки тому +9

    Great video! I really liked the explanation between both algorithms! I have a question I am not sure if it will make sense but, is there a way to calculate the uniformity of a sorted array before choosing to use binary or interpolation?

  • @nahom560
    @nahom560 3 місяці тому

    Grazie from Italy, really well explained :)

  • @girrajjangid4681
    @girrajjangid4681 2 роки тому +1

    It will more simple. We need single formula thats it- new_idx = (target_value - A[0]) / (A[1]-A[0])

    • @asaachkay
      @asaachkay 11 місяців тому

      😂 and how you came up with this revolutionary formula. By this program will go in loop 😢

  • @serendipityx737
    @serendipityx737 2 роки тому

    such an easy to understand tutorial!

  • @alonebuthappy33
    @alonebuthappy33 4 роки тому +2

    Got it in on one watch 😇

  • @rabiumuhammedeffect423
    @rabiumuhammedeffect423 2 роки тому

    great explanation

  • @harshitgupta7111
    @harshitgupta7111 4 роки тому +1

    *nice explanation*

  • @renzolim6868
    @renzolim6868 5 років тому +2

    love your vids. explained well

  • @CodeSeeker
    @CodeSeeker 2 роки тому +1

    Sir its like an AP series so can we use the formula an=a+(n-1)d
    as u said the distance between every two consecutive numbers must be equal

    • @asaachkay
      @asaachkay 11 місяців тому

      Ap gives us sum of the series but here we don't want sum so, this formula is for😊

  • @yashwanthchennu5544
    @yashwanthchennu5544 4 роки тому

    Awesome explanation Bro

  • @jeihenberb
    @jeihenberb 5 років тому +2

    What if the elements are 1,2,2,3,4,5 and i want to find the value 2 which one should it search first?

    • @techdose4u
      @techdose4u  5 років тому +2

      If you apply the formula then you get index=int(5/4)=1 (because decimal value is automatically discarded for int). Therefore, you will go and check at index 1 first and hence you will get the left 2 first. I hope you got it :)

    • @jeihenberb
      @jeihenberb 5 років тому +1

      @@techdose4u thank you so much sir

    • @techdose4u
      @techdose4u  5 років тому

      @@jeihenberb welcome :)

    • @AmarKumar-vo2bv
      @AmarKumar-vo2bv 4 роки тому

      But 1 2 2 3 3 4 5 are not in AP or GP or HP then how it will get

    • @aviraldev5109
      @aviraldev5109 4 роки тому

      But it doesn't work for finding number of duplicates example 1 2 2 2 2 3 calculations fails at a point it produce error

  • @gerardndayisenga906
    @gerardndayisenga906 3 роки тому +2

    thanks so much

  • @Spider-Man_67
    @Spider-Man_67 2 роки тому

    Superb Explanation

  • @akteruzzaman9483
    @akteruzzaman9483 5 років тому +1

    Well explained

  • @gtx1650max-q
    @gtx1650max-q 3 роки тому

    so if array uniformity is at its worst then interpolation is still good or should i use only binary search then ?

  • @hritwiksom3032
    @hritwiksom3032 4 роки тому

    What is the worst case of IS for totally random distribution, O(n)? Like I chose 10 random numbers out of say 1000 elements, sorted them and conducted a search on them?

    • @reemaalhamdan1
      @reemaalhamdan1 4 роки тому

      interpolated search means you have information on how your data relates to one another. So you can't know how many steps it will take unless you know the pattern of your data.

  • @the_ghost_of_uchiha5939
    @the_ghost_of_uchiha5939 4 роки тому

    Sir, In Binary search ,the worst case time complexity would be "log(n)", and interpolation is better than BS , then what would be its worst case time complexity? 1

  • @roshnidey865
    @roshnidey865 4 роки тому +1

    hats off sir!v thanks a ton!

  • @Yegane-j4h
    @Yegane-j4h 9 місяців тому

    for bs you said time complexity is log n cause you assumed the list was already sorted right?

  • @bibasniba1832
    @bibasniba1832 4 роки тому +1

    Thank you!

  • @sam.francis
    @sam.francis 4 роки тому +1

    Thanks a lot.

  • @jonayethossain7645
    @jonayethossain7645 4 роки тому +1

    Nice.

  • @HungryBirdStephenHaokip
    @HungryBirdStephenHaokip 5 років тому +1

    if the elements were uniformly distributed... is it guaranteed that we will get the element we are searching for in just one step .. plis answer me

    • @techdose4u
      @techdose4u  5 років тому +7

      It can be possible to get the element you want to search in just one step provided elements are in AP or GP or HP progression series. It should be possible to derive the pattern and hence the mathematical formula for Nth term otherwise it should not be possible to search any element in just one step (even though distribution is uniform). I hope you got your answer :)

  • @pencodes3580
    @pencodes3580 2 роки тому

    any explanation of the formula

  • @pein7603
    @pein7603 5 років тому +1

    nice

  • @FlexE002
    @FlexE002 4 роки тому +1

    Great explanation and topic to choose , You deserve too many applause and as well appluads
    #TECHDOSE

  • @augustoalmeida2586
    @augustoalmeida2586 4 роки тому

    Is this less than O(n)??

  • @sayak
    @sayak 3 роки тому

    but how we came up with the formula that's what I wanted to know

    • @sayak
      @sayak 3 роки тому +1

      nevermind found the proof in geeksforgeeks

    • @techdose4u
      @techdose4u  3 роки тому

      Can't say man 😅

    • @ankitgupta8797
      @ankitgupta8797 3 роки тому +1

      @@sayak Where is it?

  • @RajeshSriMuthu
    @RajeshSriMuthu 4 роки тому +1

    Yoou are Awesome

  • @harishmd7843
    @harishmd7843 Рік тому

    Sir pls tell me in Tamil or Telugu 😊

  • @MohsinTeacH
    @MohsinTeacH 2 роки тому

    I found mistake in this
    You put 27 instead of 25
    In upper case minis 1

  • @dharaniappikonda4661
    @dharaniappikonda4661 4 роки тому +1

    Tq

  • @kmsabbir007
    @kmsabbir007 3 роки тому

    Sir please give this code in java language

  • @sumeetkumarsingh9377
    @sumeetkumarsingh9377 3 роки тому +2

    His teaching is wrong while explaining the formula he says low is value at index 0 and when giving the example he says opposite of that.