[Music] what is a hashmap say you've been tasked to allocate student IDs for a university you could use an array to store this data but you would need to set the size of the array right at the start which would cause problems whenever new students joined the university you could use a linked list instead as a linked list can get bigger or smaller but this will make looking up a particular student take a long time and considering the number of students who attend the University you want the most efficient solution wouldn't it be great if
you could combine the random access capabilities of an array and the dynamism of a linked list here's where hashmaps come in a hashmap is a data structure used to store information it holds the data in a table structure that consists of two main components a key and a value for example in our university a key could be the student ID and the value could be the student's name behind-the-scenes hashmaps use a hash function to determine where to store the data the hash function takes in a key and creates a hash code which determines where to
store the value this means that identical keys will always point to the same value so you must make sure that you don't use a key that already exists to store a new value for example if instead of using student ID as a key we use the student name then we would have a problem storing student IDs for students who have the same name hashmaps use two main methods to store and retrieve data put and get once you're comfortable with the basics of hash maps you can start looking at more advanced hash map methods [Music] you