8What Is a Data Structure?
Algorithms + Data Structures = Programs.
Niklaus Wirth
A data structure is a way of organizing data in a computer so programmers can effectively use it in their programs. Throughout this book, you've already used some of Python's built-in data structures such as lists and dictionaries to search data, sort data, and more. This section of the book will teach you more about data structures and how to use them. You will also learn about new types of data structures you may not be familiar with yet, such as arrays, linked lists, stacks, queues, trees, heaps, graphs, and hash tables. Each of these data structures has advantages and disadvantages. The best data structure to use in a program depends on what type of problem you are trying to solve and what you are trying to optimize for. In Part II of this book, you will learn about the pros and cons of different data structures so that when you are building applications, you can decide what the best data structure to use will be. Plus, you will learn how to answer the most common questions interviewers ask about data structures so that when it comes time for you to go through a technical interview, you will pass with flying colors.
You cannot be a great programmer without a solid understanding of data structures because programming means writing algorithms and choosing the right data structure to go with them. That is why Niklaus Wirth famously wrote, “Algorithms + Data Structures = Programs.” The algorithm ...
Get The Self-Taught Computer Scientist now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.