Computer Science

January 25, 2018 · Computer Science Data Structures Tries as Folders in a File System

I bet you've never really thought about the file system on your computer. Sure, you use it all the time. But have you ever considered what it would be like if your computer's data wasn't organized in a hierarchical folder structure? For instance, my photos live under this path: /Users/

Continue reading...

January 16, 2018 · Computer Science Data Structures Binary Search Trees as a game of "Guess the Number"

FRIEND: I'm thinking of a number between 1 and 10. Guess what number it is! YOU: 5. FRIEND: Too high! YOU: 3. FRIEND: Too low this time. YOU: It's 4! FRIEND: Yup, you got it! Does the above script sound familiar? I'm sure it does. If you've played any version

Continue reading...

January 3, 2018 · Computer Science Data Structures Hashes as a Dictionary

An excellent analogy for the hash data structure is a dictionary. Imagine that you're spending a leisurely Sunday afternoon reading a good book. You come across a word you've never seen before: "Sisyphean". You want to look up the definition, so you consult your always-reliable Oxford dictionary. How

Continue reading...

December 31, 2017 · Computer Science Data Structures Queue as a Line of People

A good metaphor for a queue is... *drumroll* a line of people, duh! Imagine you bought tickets to see your favorite band in concert, and it's the night of the concert. As you walk up to the venue, you see a long line of people on the sidewalk. You know

Continue reading...

December 24, 2017 · Computer Science Data Structures Stacks as a Stack of Plates

You can think of a stack as a stack of plates. Seriously, if you've ever interacted with a stack of plates IRL, you already know everything you need to know about how to work with stacks as a data structure. So let's think about this. Imagine you're back in the

Continue reading...