Data Structures and Algorithms
Everyone knows that choosing the right data structure will significantly improve the performance of the code. Even two similar data structures such as arrays and collections will behave very differently in a high-load operating environment. But even if the data structure is determined, the speed of the code will also be affected by another important factor, which is the algorithm.
So, are data structures and algorithms really difficult? To be honest, they are difficult, because they are abstract and complicated. Coupled with our mindset, there is no systematic learning and practice. Many people, this is a shortcoming. Especially the novice, knowing this is important, but completely confused. Although these are difficult points, but you must understand the following byte internal notes. These are minor problems. This note introduces the basic knowledge of data structure and algorithm in a simple and easy-to-understand way, and abandons the complexities in traditional reference books. Mathematical formulas and theories are very suitable for programmers who want to improve their programming skills.
In order not to affect the way you get the reading experience, see here:
Chapter 1 and Chapter 2, explain what the data structure and algorithm are, and explore the concept of time complexity to judge the efficiency of the algorithm.
Chapter 1. Why data structure is important
- Basic data structure: array
- Collection: one rule determines performance
Chapter 2 Why Algorithms Matter
- Ordered array
- Find an ordered array
- Binary search
- Binary search and linear search
Chapters 3~6 reveal the essence of Da О notation in a way that grandma can understand. And further explore the big O notation, and use examples to demonstrate how to use it to speed up code execution. Various sorting algorithms will also be mentioned, including bubble sorting, selection sorting, and insertion sorting.
Chapter 3 Big O Notation
- Big O: Count the number of steps
- Constant time and linear time
- Same-algorithm, different scenarios
- The third algorithm
- logarithm
- Explain O(log N)
- Instance
Chapter 4 Using Big O to Speed Up Code
- Bubble Sort
- Bubble sorting combat
- Implementation of Bubble Sort
- Efficiency of bubble sort
- Secondary problem
- Linear solution
Chapter 5 Optimizing Code With or Without Big O
- Select sort
- Selection and sorting
- Implementation of selection sort
- Selection sort efficiency
- Ignore constants
- The role of Big O
- An instance
Chapter 6 Optimistic Tuning
- Insertion sort
- Insertion sorting combat
- Implementation of insertion sort
- Insertion sort efficiency
- Average situation
- An instance
Chapters 7 and 8 explore several data structures, including hash tables, stacks, and queues, show their impact on code speed and readability, and learn to use them to solve practical problems.
Chapter 7 Finding Fast Hash Tables
- Explore hash tables
- Use a hash function to hash
- A thesaurus for fun and money
- Handle conflict
- Find balance
- An instance
Chapter 8 Use t-stacks and queues to construct smart code
- Stack
- Stack combat
- queue
- Queue combat
- to sum up
- Recursion
- Use recursion instead of loop
- Base case
- Read the recursive code
- Recursion in the eyes of computers
- Recursive combat
Chapter 9 introduces recursion, a core concept in computer science. We will decompose it and examine its use value on certain issues.
Chapter 9 Recursion
- Partition
- Quick sort
- The efficiency of quick sort
- Worst case
- quick selection
Chapter 10 uses recursion to implement some fast algorithms, such as quick sort and quick selection, to improve everyone's algorithm development capabilities.
Chapter 10 Fast Recursive Algorithm
- Partition
- Quick sort
- The efficiency of quick sort
- Worst case
- quick selection
Chapters 11 to 13 explore node-based data structures, including linked lists, binary trees, and graphs, and show their perfect performance in various applications.
Chapter 11 Node-Based Data Structure
- Linked list
- Implement a linked list
- Read
- Find
- insert
- delete
- Linked list combat
- Doubly linked list
Chapter 12 Binary Trees That Make All Operations Faster
- Binary tree
- Find
- insert
- delete
- Binary tree combat
Chapter 13 Diagrams Connecting Everything
- Figure
- Breadth first search
- Graph database
- Weighted circle
- Dijkstra algorithm
Chapter 14 introduces space complexity. When the memory space of the program running environment is not much, or the amount of data processed is large, it is particularly important to understand the space complexity.
Chapter 14 Dealing with Space Limits
- Big O notation for describing space complexity
- The trade-off between time and space
At last
Junior developers of programming basics, students majoring in computer science, and developers who have not used data structures and algorithms in the ordinary time hope to review these concepts to prepare for the next technical interview. Or want to learn some basic concepts of computer science to optimize code and improve programming skills. This note can be used as a reference.