Intro to Data Structures: Software Engineering Full time 13 Phase 3 Hybrid

Close

Learning Goals


Key Vocab


Introduction

Data is information that has been standardized in such a way that it is useful to the individual or machine that is working with it. Everything that you see on your computer screen right now is composed of data. The letters in this paragraph, the colors on this page, the links and buttons that navigate to and from resources on the internet- all data.

In Python Fundamentals, we talked about the importance of organizing our code for other humans to be able to read. After all, a foolish consistency is the hobgoblin of little minds Links to an external site.. Data structures are a way for us to organize data in a way that is easy for computers to read.


Why Don't We Just Put Everything in a List?

list objects are very useful for storing data in Python, but there are many situations where a computer would want data stored in a different way.

To provide some perspective, let's compare a list with a set:

list set
Can store all types of data. Indexed - Each item in a list has a set location. Mutable - Can be extended or converted to another data type. Items can be repeated. Items can be changed or replaced. Can store all types of data. Unindexed - Items in a set are stored using an item's name. Mutable - Can be extended or converted to another data type. Items are unique. Items cannot be changed or replaced.

There are a number of similarities here, and it's clear that list objects are much more flexible than set objects. But if we're looking for which items exist rather than how many, a data structure with unique items that allows us to access them by name rather than index is more useful. Lucky for us, Python provides the set data structure out of the box!


Types of Data Structures in Python

Python gives us access to a number of different data structures to help us communicate with our computers. Some are built-in data types while others require a little more work to set up.

Data Types that are Data Structures

* We won't be covering these in our curriculum, but they may be useful to you in advanced computing contexts

Trees and Linked Lists

Python does not come with every data structure built into its data types, but the standard library includes several modules and packages that help us build out more complex data structures. Trees and linked lists are two of the most common. We'll discuss these later on in Phase 3.

Be sure to check out the resources below as well, and bookmark them for future reference!


Resources