LinkedHashMap and LinkedHashSet in Java | Internal Working
HTML-код
- Опубликовано: 2 фев 2025
- Start protecting yourself on the web at nordvpn.com/dcb or use code "dcb" to get a 2-year plan plus a bonus gift with a huge discount
In this video, I have explained what is LinkedHashMap & LinkedHashSet in Java and How LinkedHashMap & LinkedhashSet works internally with full-example
🎟 Join this channel to get access to perks:
/ @dailycodebuffer
RECOMMENDED COURSES
🎬 Spring Boot + React Full Stack Web Application with Tailwind CSS - • Spring Boot + React Fu...
🎬 Spring Security Full Course | From Registration to Login - • Spring Security Tutori...
🎬 Microservices using SpringBoot | Full Example - • Microservices using Sp...
🎬 Event-Driven Microservices with CQRS Design Pattern - • Implement CQRS Design ...
🎬 Implement SAGA Design Pattern using Spring boot and Axon Framework - • Implement SAGA Design ...
🎬 Spring Data JPA Tutorial | Full In-depth Course - • Spring Data JPA Tutori...
🎬 Deploy Springboot Microservices to Kubernetes Cluster - • Deploy Springboot Micr...
🎬 Automate Microservices deployment with Github Actions - • GitHub Actions Tutoria...
🎬 Go / Golang Full Course for Beginners - • Golang Tutorial for Be...
🎬 Node JS Full Course for Beginners: Learn in 2 Hours - • Node JS Full Course fo...
🎬 Express.js Tutorial - Beginner | 2021 - • Express.js Tutorial - ...
🎬 Redis CLI Tutorial | Complete Course - • Redis CLI Tutorial | C...
BE MY FRIEND:
👨💻. Website: www.dailycodebu...
👨🏫 Facebook: / dailycodebuffer
🐦 Twitter: / dailycodebuffer
📸 Instagram: / dailycodebuffer
🎮 GitHub: github.com/dai...
MY FAVOURITE GEAR:
👨💻 My Macbook Air M1: amzn.to/3eFXlID
💻 ASUS ROG Zephyrus G14, 14": amzn.to/32xsXhf
💻 ASUS ROG Zephyrus G14, 14" (US): amzn.to/3xa6X6m
🎤 My Main Mic: amzn.to/3qDl0z0
🎤 My Main Mic (US): amzn.to/3awzUj7
🎙 My Secondary Mic: amzn.to/3sOZCJW
🖥 My LG Monitor: amzn.to/3zhLY3e
🖱 My Mouse: amzn.to/3eDpRKT
⌨️ My Keyboard: amzn.to/32xthMZ
RECOMMENDED BOOKS:
📙 Mastering Spring Boot 2.0 (Kindle): amzn.to/3HsOiHu
📙 Mastering Spring Boot 2.0 (US): amzn.to/3tHNUy5
📙 Building Microservices(Kindle): amzn.to/3gsA1jL
📙 Building Microservices(US): amzn.to/3dDnfNn
📙 Spring Boot in Action: amzn.to/32Nf3qW
📙 Spring Boot in Action (US): amzn.to/32DkeX9
📙 Spring Microservices in Action: amzn.to/3mQ4sCH
📙 Spring Microservices in Action(US): amzn.to/32G3Hl7
🎻 MUSIC:
🎵 Hear the Noise (Sting): www.youtube.co...
“Sound effects obtained from www.zapsplat.com“
#collections #Linkedhashmap #linkedhashset #java #DailyCodeBuffer
I have lot of confusion in-between LinkedHashMap vs LinkedHashSet , now everything is cleared, thanks bro, great work.
🙏🏻🙏🏻
Thanks!
Thank you so much 🙏🏻🙏🏻
Plz keep making videos
And you are completing the whole
Video in the particular topic
Makes this channel best place to visit and see
Thank you so much 😊
Would you consider making a DSA series ? Covering programming techniques for solvnig different kinds of questions and Data structure related questions asked in FAANG companies.
Planning on it if more people are interested
@@DailyCodeBuffer Yes.. do it please
@@DailyCodeBuffer : please consider LLD videos also.
@@DailyCodeBuffer Please create as these are things which I feel most of people lack and fail when asked in interviews
Please do it.
Perfect explanation! Thanks a lot!
Nice Explanation. I have one doubt here. the index is calculated based on hashing() method? we have one logic like index = hash& (n-1). i hope same formula applies here?
Also Please make DSA videos as well. we are eagerly waiting.
Thank you for the video sir, didn't think I could find the explanation so easily
Glad it helped
Thank you a lot! Your explanation is cool and it helped me understand how LinkedHashMap works internally!
Glad it was helpful!
Great work as always❤
Thanks 🙏
Thanks for the detailed explanation.
One question what about the uniqueness of elements ? Because it is unique in set always so it will always be unique in linked hashset also?
Yes
Boht badiya. Too good.
Hi Shabber it was a clear and easy explanation. Please add a video on internal working of ConcurrentHashMap
Thank you so much
Working on it
It's the same as HashMap except it does it's write operations in a monitor region and applies a segment level lock on the buckets so only the buckets where data is being written are locked and rest are free for use. Read operations do no require locks at all.
@@DailyCodeBuffer Concurrent hashmap YES PLS
Will you make a video on Oops.. if possible?
If hash collision happens then how linkedhashmap() works internally? . Thanks in advance
What is the Difference between Node and a Entry ?
Love you buddy cleared my concept totally
Glad it helped
can you made an vedio on Equals and hashcode also with various cases..sometimes it comes confusive : (
Happy to see you again bro 🙂🙂
Thanks buddy 🙏🏻
Well explained.
What if the key is an object? Will the next and before be resolved by sorting whatever is returned by the hashcode()?
Besides of delicacy going hand in hand with making use of objects as keys in HashMap: At first: hashcode() on your key-object is called, after that the link to your object is copied into the array's node, after links "next" and "before" (or whatever they're called in java) are renewed, pointing to the node. Were your key-object mutated in the meanwhile, it wouldn't have no impact of next and before pointers. But the hash is toast now, I mean whether mutation changes hash code or not, which is also pretty easy to implement, either way make the value unreachable outside of the map sooner or later, but because the pointers inside the map still live, the value is hardly going to be garbage-collected, unless we make use of weak- or softHashmap.
in short-lived-objects it can by considerable, but in long-term state like caching or it can cause a huge pain in the ass. As for me. imho
Well, if we have to do with kinda object that we send to the client and later it's supposed to come back, well then our client will probably have done some mutations on it, won't it. That's why I'd rather call hashCode() on our object-to-send by myself, put this hashcode integer value as key into the map and store it into the specific field in our object-to-send. Once it's back again, I just get the stored value from the field and can keep using it as key. The hashCode() here works like an non-unique id.
This linkedhashmap seems pretty complicated. Nicely explained. Why use this rather than a hashmap. Thank you
To maintain insertion order
1) you might want to copy a map with guaranteed the same order as in the origin map
2) you might want to keep track of insertions for instance by implementing LRU-cache. For this particular case you'd use following constructor: public LinkedHashMap(int initialCapacity,
float loadFactor,
boolean accessOrder)
Thank you for detailed information
@@DailyCodeBuffer Was pleasure. I like your content. Honestly, mentioning implementation of lru-cache was kinda unrealistic of me. I think, Coffeine has ConcurrentLinkedHashMap, which almost covers all needs, unless we're dying to create something very special and customised.:D
amazing explanation !
Thanks 🙏🏻
ladka sahi samjhaya hai 👍👍
🙏🏻🙏🏻
Yesterday in an Interview,this question was asked to me..i could not explain it..😞😞
Hope this video helps and you will rock next interview
What is head and tail.
head is the start of the LinkedList & tail is the end of LinkedList. Understanding Linkedlist would help in understanding hashmaps better
Good more helpful 👍
Thank you 🙏🏻
first one 🙏🏻
Thanks Kavita 🙏🏻