How are HashMaps implemented in Java? Internal Working Explained With Code | IMP Interview Question

Поделиться
HTML-код
  • Опубликовано: 5 сен 2024

Комментарии • 39

  • @animeshjaiswal3878
    @animeshjaiswal3878 Год назад +9

    Hey Ridhi, I watched your Collection Framework and Multithreading videos before 1 week of my interview and I am very happy to tell you that I got selected out of 10 candidates to that company for Java profile. Your teaching style is just so awesome. Please keep on posting new videos brother.
    May God give you all the happiness 💝🙏🏻

    • @rite2riddhi
      @rite2riddhi  Год назад

      So happy for you. Congratulations

    • @bhutaleomkar6050
      @bhutaleomkar6050 11 месяцев назад

      @@rite2riddhi there is no such deep explanation videos on youtube which you teach in past as well as now ,with the super Teaching style, thank you sir

  • @shankar7435
    @shankar7435 9 месяцев назад

    Excellent explanation without any kind of repetition. Great content on RUclips.

  • @kapilchoudhary2922
    @kapilchoudhary2922 Год назад +1

    Brilliant explanation bhaiya! 💯💯

  • @dayashankarlakhotia4943
    @dayashankarlakhotia4943 Год назад +1

    Good explanation with code much intuitive

  • @Kavya20-22
    @Kavya20-22 Месяц назад

    Worth watching your videos 💯..but shocked to see very less views . Do keep posting more videos on java

  • @Anilkumar-reddy
    @Anilkumar-reddy Год назад +2

    Finally , Master Java is back on youtube. Good See you

  • @ketansarode17
    @ketansarode17 7 месяцев назад

    Really the best explanation ever on hashmap implementation ❤👍

  • @sounishnath513
    @sounishnath513 Год назад +1

    ❤❤ if you ask me i must day while watching the full video your explanation did not feel like I’m watching via RUclips. ❤❤ i feel like we are directly interacting.
    Super Riddhi da ✨. More this type of titbits we need . Kudos

  • @user-sc6fd4xz5n
    @user-sc6fd4xz5n 9 месяцев назад

    Hi riddhi it was really great explanation but there is small change in code need to wrap Math.abs(key.hashCode()). there can be negative hashcode and negative numbers will give the error while getting the index of the table(bucket)

  • @HamzaKhan-wi9kb
    @HamzaKhan-wi9kb 7 месяцев назад

    great video Riddhi, but just to point out the hashcode function does not give the memory address of the object.

  • @prateek6424
    @prateek6424 Год назад

    I haven't seen any explanation on Hashmap that has this much depth.
    But It would have been even better if you discussed the worst case time complexity under high hash collisions would be O(n) in this linked list implementation and it can be reduced to O(log n) using balanced BST.
    Can you please discuss in a separate video about this Balanced BST implementation when the treeify_threshold has been crossed ??

  • @ayushsingh2431
    @ayushsingh2431 Год назад

    It's a good video. Didn't find such content.

  • @sahilgandhi9156
    @sahilgandhi9156 Год назад

    Thanks Riddhi

  • @sankarapuvishnuvardhan4418
    @sankarapuvishnuvardhan4418 Год назад

    A great explanation Riddhi. Thanks for explaining in such deep, as it is very important to know about load factor and initial capacity. We can also provide a constructor which takes initial capacity and load factor arguments also right? as it's done in the default HashMap class.Again, thanks for your effort

  • @rollactiontalk549
    @rollactiontalk549 Год назад

    please continue java series

  • @factnoted
    @factnoted Год назад +1

    Hi Riddhi,
    Can you also talk about why you were not using this keyword to set/update the values. Example this.size=0, this.capacity=INITIAL_CAPACITY

    • @rite2riddhi
      @rite2riddhi  Год назад +1

      You can do that , but that is not required.

  • @SnehansuPradhan
    @SnehansuPradhan Год назад

    Sir make a full playlist of spring and spring boot

  • @thimothipalipaka852
    @thimothipalipaka852 Год назад

    1hr back only done this problem using the hashmap. It takes lot of memory size than nested for loop to find number of occurrences of an element . Basically i from non it which one should I prefer space complexity or time complexity to design the alogorothm

  • @rohitsriwastav3174
    @rohitsriwastav3174 Год назад

    Great explanation. I have got a different level of clarity in internal working of Hashmap. But I still have one doubt regarding the reduction in collisions. Suppose, the load factor crossed the threshold and we doubled the bucket array size and rehashing is also done but now also only the bucket index is going to change because of the change in compression function but for the objects which had same bucket index before rehashing, they will still be having the same bucket index just at a different index now.
    So, after rehashing , how does Hash fucntion will reduce the collisions??

    • @singer9783
      @singer9783 Год назад

      Hi Rohit,
      let's suppose that initially the bucket size is 10 and we have two objects A and B with hashcode 21 and 31 respectively. when we try to calculate their bucket index, we will get 1 in both cases since 21%10 == 31%10 == 1 and hence both will be stored at same index.
      now, let's increase the bucket size to 20 and again calculate the bucket index. now for A, the index will be 21%20==1, but for B index will be 31%20==11. so now we have two different indexes for these objects and hence the collision is reduced.

  • @anubhavsingh9888
    @anubhavsingh9888 Год назад

    Amazing!!

  • @pratosh
    @pratosh Год назад

    Please make a tutorial on springboot

  • @accforgame8563
    @accforgame8563 Год назад

    I need advice m fresher struggling to get a entry job using java stack
    What i want to know is shud i be doing advance topics of java the ones u teach seems little advance or i should stick to core and only practice that

  • @karanjitsinghrandhawa445
    @karanjitsinghrandhawa445 Год назад

    Hi sir currently I am working as a flutter developer in Renault Nissan
    And I am preparing more DSA for top product based company can you please tell will my tech stack i.e flutter will be reliable for companies like faang please sir

    • @rite2riddhi
      @rite2riddhi  Год назад +1

      They don't care much about tech stack.

    • @karanjitsinghrandhawa445
      @karanjitsinghrandhawa445 Год назад

      @@rite2riddhi then i can concentrate on DSA, system design and projects for my resume right sir?

  • @supratikdutta6612
    @supratikdutta6612 Год назад

    @riddhi can you share the code

  • @debojeetchdfhdfh4839
    @debojeetchdfhdfh4839 Год назад +2

    where do u work currently??

  • @kp-cj8ro
    @kp-cj8ro Год назад

    Your voice is getting resound i thought that was due to your room....can you pls resolve it if possible....

    • @rite2riddhi
      @rite2riddhi  Год назад

      Sure. Thanks for pointing out.

    • @kp-cj8ro
      @kp-cj8ro Год назад

      @@rite2riddhi My pleasure sir....very useful videos keep going we always support you....😇😇