24
loading...
This website collects cookies to deliver better user experience
.add()
.get()
.sort()
.search()
A linked list is a linear data structure that consists of nodes. A node consists of a value, which can simply be a number, and a reference link that points to the next node in that list. Hence, it being a linear structure that keeps going on and on. The start of a linked list is known as the head, where as the last node, is known as the tail or null.
Arrays have a familiarity across almost all programming languages, so you should probably be familiar with them. An array is a collection of data items stored in adjacent memory locations. Arrays keep memory of all the locations of the data items.
A hash table stores a collection of keys and values. It's an important type of data structure, because after you give a hash table a key, it's able to return its value. Even though it's similar to an array, what makes hash tables special is once you provide a hashing function, it automatically retrieves the data and it does not have to be stored next to one another like an array.
Stack and queues are very similar to each other, and they are built from the same structure as arrays. With stack, the last item you put in is the first item to go out. Two methods used are .push() and .pop() to carry out this behavior. On the other-hand, queue operates as first item in, is the first item to go out. Adding an item to the end is known as .enqueue() and removing an item from the front is .dequeue()