Ever thought how hashmaps work internally in java ,, lets understand
So in java , array of LinkedLists is used to implement hashmap.
for example when we write
HashMaphmap=new HashMap<>();
hmap.put("sss",1);
when we intialize a hashmap a array of linkedlist is created of size 16
where each index of that array represents a linkedlist. Now when we put the value inside it , it takes the key and generates a hash value , then that hash value is converted to a index number by doing '&' operation with the length of the array
After that the data is stored at that index , as a node of linkedlist , SO the what data that node stores ?? (1)hashed value (2)key (3)value (4)next
Master the Magic of HashMap in Java!
Curious about how HashMap works behind the scenes?
🤔 Learn about hashing, buckets, and collision handling to boost your Java skills and optimize your applications for peak performance.
Ready to dive in? Expl
See More
2 replies9 likes
Prince Singh Chouhan
Stealth • 7m
#Array in #javascript:
Array in Javascript enables storing a collection of multiple items under a single variable name, and has members for performing common array operations. Arrays aren't primitives but are instead Array #objects with the followin
See More
0 replies2 likes
Somen's 8D world
Stealth • 8m
Array.reduce() is Goated the Swiss army knife
Summing Numbers: Using reduce() to calculate the sum of numbers in an array.
Flattening Arrays: Flattening a nested array into a single array.
Grouping Objects: Grouping objects based on a speci
See More
0 replies5 likes
Atharva Deshmukh
Stealth • 7m
The Stock Market Index
When we want to know about the trends in the market, we need to analyze few of the important companies in each industry. The important companies are pre-packaged and continuously monitored to give you this information. This pr
James Gosling, creator of Java, announced that he is retiring
0 replies8 likes
Dileep Kadiveti
Stealth • 6m
[This post has been deleted by the creator]
2 replies4 likes
Rohan Saha
Stealth • 3m
I focused exclusively on trading the index this month, and fortunately, not a single stop loss was hit, thanks to God. I recognize that profits from the index are lower than those from stocks, but trading the index is somewhat easier in a competitive
See More
4 replies9 likes
Prince Yadav
Stealth • 9m
Today I Learnt stack using Linked list and Array in C++.
Here is a Code of Stack Using Linked List.
0 replies5 likes
Rohit Gupta
Stealth • 9m
Day30 of 100daysofcodechallenge...
Today I learned about Object Literal, Array of object and Math object In JavaScript. I also make a basic "Guess The Number" game.
5 replies8 likes
Rohit Gupta
Stealth • 9m
Day30 of 100daysofcodechallenge...
Today I learned about Object Literal, Array of object and Math object In JavaScript. I also make a basic "Guess The Number" game.