Introduction to Data Structures and Algorithms
What Are Data Structures?
Data structures are different ways of storing data on your computer. For
example, let's say you want to make a system similar to Google Maps for your
neighborhood. You have all the locations' coordinates, but you need to store
information about how these locations are connected with streets. There are
different options for storing this information, such as:
Storing all possible paths in a list format
Listing each location and the places you can go from there
In this example, the first method corresponds to the array or a list data
structure, and the second method corresponds to the hash table or hash map
data structure.
What Are Algorithms?
Algorithms are sets of instructions for performing operations on different data
structures. For example, let's say you want to find the shortest path from your
home to your school. You can come up with a systematic set of instructions to
solve this problem, such as:
1. Find all the places you can go from home
2. From each of those places, find all the paths you can take to school and keep
track of the distance traveled for each path
3. Compare the distance traveled and pick the shortest path
Depending on the data structure you use, the algorithm might look slightly
different. It's important to learn data structures and algorithms to write
efficient software as a software developer.
Practical Use of Data Structures and Algorithms
Learning data structures and algorithms can be useful in many practical
situations as a software developer. For example, when working at Microsoft as
a data science intern, I had to retrieve some data, and the original code was
taking too long to load. By rewriting it using my knowledge of data structures
and algorithms, I was able to reduce the loading time from 7-10 hours to 5-10
minutes.
What Are Data Structures?
Data structures are different ways of storing data on your computer. For
example, let's say you want to make a system similar to Google Maps for your
neighborhood. You have all the locations' coordinates, but you need to store
information about how these locations are connected with streets. There are
different options for storing this information, such as:
Storing all possible paths in a list format
Listing each location and the places you can go from there
In this example, the first method corresponds to the array or a list data
structure, and the second method corresponds to the hash table or hash map
data structure.
What Are Algorithms?
Algorithms are sets of instructions for performing operations on different data
structures. For example, let's say you want to find the shortest path from your
home to your school. You can come up with a systematic set of instructions to
solve this problem, such as:
1. Find all the places you can go from home
2. From each of those places, find all the paths you can take to school and keep
track of the distance traveled for each path
3. Compare the distance traveled and pick the shortest path
Depending on the data structure you use, the algorithm might look slightly
different. It's important to learn data structures and algorithms to write
efficient software as a software developer.
Practical Use of Data Structures and Algorithms
Learning data structures and algorithms can be useful in many practical
situations as a software developer. For example, when working at Microsoft as
a data science intern, I had to retrieve some data, and the original code was
taking too long to load. By rewriting it using my knowledge of data structures
and algorithms, I was able to reduce the loading time from 7-10 hours to 5-10
minutes.