Linked Lists
Data Structures are ways in which one can organize data.
An array is one type of data structure.
[1, 2, 3, 4, 5]
An object is another type of data structure.
{ “name”: “Stephen” }
Data Structures are made up of bytes of data that is physically stored somewhere in memory.
Static Data Structures are stored immediately next to one another. Because these data structures all need to be stored together, if they need to be modified then they will need enough space, which may require they make a copy of themselves somewhere in memory that can hold them.
Dynamic Data Structures are stored in a bunch of disconnected pieces. They use pointers to direct the flow of data. They know about the data they hold and who their neighbor is. That’s it.
Linked Lists are made up a series of nodes. The first node in the series is called the head. The head is the only entry point into the linked list. The end of the list isn’t a node, but rather a node that points to null, or an empty value. A single node is also pretty simple. It has just two parts: data, or the information that the node contains, and a reference to the next node. A node only knows about what data it contains, and who its neighbor is.