What is Jump Search and how does it work (with CODE)

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

КОМЕНТАРІ • 51

  • @spetsnaz_2
    @spetsnaz_2 5 років тому +8

    5:40 if you are searching for time complexity of this algo.

  • @iankamandew9777
    @iankamandew9777 9 місяців тому +2

    very clear and concise, thank you!

  • @Jyotigupta-vs4mz
    @Jyotigupta-vs4mz 3 роки тому +5

    excellent,i wish i could be like u one day

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

      Just keep practicing and you will be :)

  • @jagadeeshr91
    @jagadeeshr91 3 роки тому +3

    clear cut explanations, thank you very much

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

    God bless those indian guys!! They save the whole it department!!

  • @user-fl7bm8jc8o
    @user-fl7bm8jc8o 2 роки тому +1

    Loved it sir 🙌

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

    Thaaaanksss a lot for such clear explanation

  • @EricSullano
    @EricSullano 4 роки тому +6

    Thank you for the video. When would a jump search algorithm (or linear algorithm for that matter) be the optimal / preferred choice over a binary search?

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

      Binary search and jump search will be used in cases where you are dealing with a sorted array, whereas you can use linear search with sorted or unsorted array. Binary search and Jump search have complexities O(logn) and O(sqrt(n)) so they will be faster compared to linear search which has complexity O(n).

    • @manavgupta522
      @manavgupta522 4 роки тому +6

      @@rutwikhiwalkar9583 how does that answer the question he asked?

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

      Nope. Binary Search forever

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

      @@rutwikhiwalkar9583 Yes.

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

      @@manavgupta522 That answers the question because he is saying you would use linear search when it is unsorted array, as you cannot use binary or jump search then. Unless you have to perform multiple searches and it becomes more efficient to sort then do binary.

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

    Nice explanation.... keep it up
    💯💯💯

  • @IshaZaka
    @IshaZaka 2 місяці тому

    explanation is so good, what drawing tool you are using?

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

    could you please explain why, at 1:55 did you assign 3 to the higher point? what's the logic behind assigning 3 instead of 2 or 4? also, at 2:45 you specify the number of jumps is 1, but going from 0 to 1 you took 1 jump, 1 to 3 that's jump 2. thanks

    • @SamuelGselassie
      @SamuelGselassie 7 місяців тому

      its because the data is sorted, so if you jump the array by 3 and compare the value and if it is less than the value we are looking for then it not in the part of array that is jumped, this method decrease the time needed, compare to checking each one by one but this only work on sorted data

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

    this is square root decomposition use case.

  • @Pardhu-g5g
    @Pardhu-g5g 9 місяців тому

    osm explanantion anna

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

    why did you differentiate exactly? the concept behind that?

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

    how can i determine the exact number of indexes to jump?
    because sometimes it can jump from index 0 to index 4 and then to index 8 and so on...
    then there are times that it can jump from index 0 to index 3, then index 3 to index 7 and so on...
    pls notice me. thank you

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

      watch my video easy explanation
      like nd subs if understand

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

    sir can u plzz upload a video on " sorting of array elements according to their frequency"
    really need to understand the efficient approach to solve this question , i have a interview in a week .
    thankyou

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

      It's impossible to make video in such hurry. I will give you the logic. Can you use a map with KEY as array element and the frequency as VALUE. So, whenever the same number comes then you can just increase the frequency VALUE by 1. At the end, sort the Map by VALUE. MapSize = No of unique elements. I hope it's clear now.

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

      @@techdose4u Thankyou Sir, is it the most efficient way?

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

      One of the most efficient is the one I told you. Don't answer this directly when asked. First answer bruteforce and then answer the optimized approach.

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

      @@techdose4u thankyou so much sir

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

      Welcome :)

  • @Kevin-zv2xm
    @Kevin-zv2xm 3 роки тому +2

    In the question we did in the beginning we get number of jumps = 5 but if we substitute the values of m= 3 and n= 12 in the formula, we are getting 6. Can you please explain what is going on here?

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

      I think his formular should have been [((n-1) / m) + ((n-1) % m)]

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

      He actually corrected m to be the number of elements in a block so with that he actually has 6 blocks [0;2] [2;4] [4;6] [6;8] [8;10] [10;12] which actually yields 6 but his explanation on that part isn't so clear but nice search he shared.

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

    I cant understand him but praise ganesh the lord

  • @gnt10
    @gnt10 9 місяців тому

    Is there a reason to use jump search instead of binary?

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

    Please post more videos

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

    Why do we need to use differentiation for finding the complexity?

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

      We don't need deffenentiation to find complexity. Here we used differentiation to find optimal chunk size

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

    Can you do a pivot search

  • @akhilk.6625
    @akhilk.6625 4 роки тому +2

    Where's the code..?

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

      It is in the description. Please read it and let me know if you couldn't find it.

    • @akhilk.6625
      @akhilk.6625 4 роки тому +2

      My bad.. Didn't see the description...And thank you..

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

      Welcome :)

  • @هبهحسين-ي2ن
    @هبهحسين-ي2ن Рік тому

    عاشت الهند

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

    5555555555AAAAHHHHHHH YA3AAAAAMMM

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

    555555555555555AAAAAAAAAAAAAH