HashMap implementation in JavaTech by Sunny Srinidhi - January 3, 2020January 3, 20203 More in The Data Structures series. In our data structure series, we have already looked at a couple of ways in which we can implement a stack, and also Single Linked Lists (SLL) and Double Linked Lists (DLL). In this post, we'll see how we can implement our own HashMap and see a couple of examples of how we can use that HashMap. Let's get started. The HashMap Before we can start with the implementation of the HashMap, we need to understand how the stuff actually works. This is a combination of an array and a LinkedList. So it's a bit interesting. When we add an item to a HashMap, we provide a key and a value. The key will be used as a
Single Linked List Implementation in JavaTech by Sunny Srinidhi - December 23, 2019December 23, 20191 More in The Data Structures series. In the previous post, we saw how a stack can be implemented in Java. But as that was the first data structures post on this blog, I used an ArrayList internally. In this post, we'll implement a simple Linked List in Java. Starting with this post, we'll be getting serious about these data structure implementations. So we'll write 100% custom implementation without using any built-in classes in Java. Also, I'm not going to explain how the data structures work. Which means, in this post, I'll not have illustrations like I had for the stack implementation post explaining each step. So we're going to jump right into the implementation from now on. The Node We know that any linked