A Brief Overview of Data Structures and Big-O Notation
Looking for a great (remote only) React Dev? Visit my profile on LinkedIn and say hi! 😃
DISCLAIMER: Most of the content in this post comes from the fantastic course by Kathryn Hodge — Programming Foundations: Data Structures on LinkedIn Learning. I highly recommend taking the course!
Data structures are containers. They allow us to combine several pieces of data into a single structure.
A Data Structure is a collection with a defined way of accessing and storing items.
Primitives
Primitives are numbers (e.g. int, float, double, long, etc), characters, and booleans.
Reference Types
Reference types are Strings, Arrays, Objects, and other Data Structures.
Since we use a reference to find where the data lives in memory, we call Strings and other Data Types implemented with data structures Reference Types
. We also use the word object
to describe a value in memory referenced by an identifier.
Reference types reference their specific value from an address of where the item is stored rather than direct access to the data itself. This means if the address changes, the value the variable represents also changes.
Again, it’s important to remember that with reference types, we are adding this extra address layer whereas with primitive types, we directly access the data.