Intermediate Data Structures
Data structures are a technique of organizing data into a prespecified arrangement for efficient processing. Efficiency could be in favor of disk space or RAM, or execution performance.
Before any further explanation, lets us have a look at an example. Suppose you want to sort three numbers in ascending order stored in three different variables. Here is one way to do it.
0 1 2
As you can observe, the solution is hard to follow, understand, and repetitive. It might give results for three variables, but what will happen when sorting thousands or millions of values. It's almost impossible to write programs using the above approach. Instead, we require a better way of managing data. Hence, we need Data Structures.
Data structures are a technique of organizing data into a prespecified arrangement for efficient processing.
These are some of the different data structures in computer science:
Covering data structures is beyond learning Python, as it is not a Python concept but a computer science concept.
You can read about data structures from external sources .
As we have learned, Data structures are imperative in structuring and processing data with maximum efficiency. Python provides several in-built data structures for processing data.
Python's in-built data structures:
We will explore data structures in Python in detail separately.
Here are five widespread usages of data structures.
Data structures allow for optimal resource usage such as disk space or RAM, or computational performance.
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
As illustrated in the above example, we could sort numbers efficiently using Lists, an in-built data structure in Python.
In this chapter, we learned about data structures, their importance while developing large, maintainable systems while keeping the data organized and improving processing efficiency.