Data Structures

Theory - Only Two Building Blocks

Lesson

For simplicity, we showed numbers as being stored in-place in the array in the video. However, Python arrays really store pointers to their data, not the data itself (Arrays Store Pointers). The takeaway is the same - there are only two building blocks that make up all data structures - this just means in Python all "edges" are really just pointers!

Takeaways

Every data structure is made of two building blocks. These building blocks make up every data structure you'll ever come across:

Nodes that contain raw data, like the number 7.

Nodes that tell you where to go to find other data like on the right. They're implemented as Arrays or HashMaps, and in Python their edges are always pointers. To see how this works in Python, hover here:

Mark as Completed:
Submits:
test
Test your code to get an output here!