Тёмный

#24 - How HashSet works Internally? Do you know HashSet uses HashMap Internally? (Java Collection) 

Naveen AutomationLabs
Подписаться 390 тыс.
Просмотров 60 тыс.
50% 1

Опубликовано:

 

29 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 44   
@hiteshdarji9925
@hiteshdarji9925 11 месяцев назад
Naveen bhai In debug mode no table showing.Baki aapka video kamal ka he . Maja aa gaya.
@DurgaShiva7574
@DurgaShiva7574 3 года назад
what a video....what a quality content , what a learning...THANKS A TON SIR..
@sumitkumar-kg1xb
@sumitkumar-kg1xb 2 года назад
Supper point-to-point explanation.. Great thanks for making such a good video.
@azeemmirza9855
@azeemmirza9855 3 года назад
Your explanation is on point bro...thanks
@manojvg2646
@manojvg2646 Год назад
wha what an explanation , exactly what I want to learn
@vivekpathak3643
@vivekpathak3643 2 года назад
This video really helped, thankyou!
@chemudupatikarthik8
@chemudupatikarthik8 2 года назад
Wonderful explanation. Thank you so much!
@Hadabe-nai
@Hadabe-nai 2 года назад
Great piece of information. Thank you 😀
@linexustjk6061
@linexustjk6061 Год назад
Thanks a lot... This is helping a lot
@nadaquever5161
@nadaquever5161 Год назад
killer interview question ;v
@madansingh-rw9ve
@madansingh-rw9ve 2 года назад
your content awesome, thank you for providing great content
@vedantupadhyay5927
@vedantupadhyay5927 7 месяцев назад
Can you provide link which you open at end of video where souce code of hashSet there. Please
@niteshpandey8207
@niteshpandey8207 Год назад
great explanation thank you.
@bhushan7546
@bhushan7546 2 года назад
very nice and clear explanation 😊
@tannubajpai4782
@tannubajpai4782 3 года назад
best explanation by u Sir
@adaickalam
@adaickalam 3 года назад
well explained... thank you.
@jainlove
@jainlove 2 года назад
Amazing series ❤️
@harshachakraborty3505
@harshachakraborty3505 3 года назад
This is very useful 👍
@rakhikhatri8878
@rakhikhatri8878 3 года назад
As in your video we can see HashMap while debugging the code but same way I am doing but unable to see HashMap after adding string value. please tell me where I am doing mistake.
@sriramkukkadapu
@sriramkukkadapu 3 года назад
Nice explanation but why it is implemented this way ? Is there any advantage of doing it this way ? And what is the use of the PRESENT object ? @Naveen
@B-Billy
@B-Billy 3 года назад
1. Reusability of code. 2. PRESENT is used because Map required a value if you want to store something into it. So PRESENT fulfilled that requirement.
@pratapjavasingh3239
@pratapjavasingh3239 3 года назад
As u know set will not Store the duplicate value but did u ever though how exactly set will not Store the value that reason is set algorithm is written in such way that check if u are add the elements throughout the add method then internally ur source code interpret according to ur jdk inside classloader and it will call the specific for set library and then set algo library check in same way if u are not comfortable "Present" then u can take any variable and it is same work as a Boolean to check data is already present or not and u want see ur source code if u decompile there Present is available and if u want create ur own custom set then followed the same approach whatever for writen is set algorithm
@muzamils.l.236
@muzamils.l.236 3 года назад
thanks naveen didn't knew until i watch this👍
@jajatisahoo3831
@jajatisahoo3831 2 года назад
Awesome
@ravikumaryerrolla8974
@ravikumaryerrolla8974 3 года назад
Very well explained Naveen, however what I observed here, if HashSet not follow insertion order then why is it implementing SortedSet interface, I believe HashSet extends AbstractSet and implements Set interface. Please Advise if am wrong.
@martingalvan1446
@martingalvan1446 3 года назад
HashSet do not implement SortedSet interface
@jananiramesh6978
@jananiramesh6978 2 года назад
I have a doubt, does present stores the address of null value? So it points to null ?
@saxenahimanshu6584
@saxenahimanshu6584 3 года назад
Nice Info but I unable to open that info while hover toggle point and display map then table , etc, the version I am using on windows won't provide that many details. Please provide some solution for this. Thanks
@priyanshusinha7056
@priyanshusinha7056 3 года назад
Thanks bro ❤️❤️❤️❤️
@kumarjadhav6106
@kumarjadhav6106 2 года назад
public class Emp{ int id; String name; //Constructor overrided with args public static void main(String[] args){ Emp e1=new Emp(1,"A"); Emp e2=new Emp(1,"A"); Emp e3=new Emp(1,"A"); Emp e4=new Emp(1,"A"); Set set= new HashSet(); set.add(e1); set.add(e1); set.add(e2); set.add(e3); set.add(e4); System.out.println(set); } } Please explain this scenarios When hashcode and equals both overrided or any one of them is overrided or none of them are overrided
@VaniDatta
@VaniDatta 3 года назад
When I mouse over I can see Hash Code but can not see Java.Lang.object@address. Why? Thanks much in advance 🙏
@kalpanan7164
@kalpanan7164 3 года назад
For me also same thing happened
@shubhampandey8765
@shubhampandey8765 3 года назад
HashSet doesn't allow duplicates, isn't "over here" is repeated "over here" ? :) Jokes apart, nice explanation though.
@AjayKumar-ju6sl
@AjayKumar-ju6sl 3 года назад
Sir , How constructor with Collections works ??
@surajgoenka
@surajgoenka 3 года назад
You didn't tell what if we try to add duplicate element
@crimsonx_
@crimsonx_ 3 года назад
When u add duplicate hashset simply ignore.. ignore in a sense that it is overwriting the previous value with new one. if i add "abc" again i add "abc" both are same value previous abc will be overwritten.
@crimsonx_
@crimsonx_ 3 года назад
see his hashmap implementation video.
@kumarjadhav6106
@kumarjadhav6106 3 года назад
What happens when we add duplicate objects.?
@B-Billy
@B-Billy 3 года назад
If the object already exists, it does not store the object and return false.
@glennmaxi7542
@glennmaxi7542 3 года назад
is hash collision happens in hashset?
@KunalSharma-ki8rd
@KunalSharma-ki8rd 3 года назад
Yes, As It uses the same implementation of HashMap So If we continue on this then we can goto the Bucket Size, Collision Handling Balanced Binary Tree. Everything is same!
@himanshumamodiya1827
@himanshumamodiya1827 3 года назад
why they have implemented in this way ?
@dharanyuvi6951
@dharanyuvi6951 2 года назад
I think the developers might have thought to implement a list like datastructure with hashing in it. This is just my assumption.
Далее
Set and HashSet in Java - Full Tutorial
20:43
Просмотров 226 тыс.
🔔 Top 5 mistakes with Java Sets!
17:58
Просмотров 26 тыс.