What is a data structure: An arrangement of data in a computer's memory.
What are the data structures? Advantages and disadvantages?
1. Array; fast insertion (know subscript), slow query, slow deletion, fixed size;
2. Ordered array; slower than unordered query blocks, deletion and insertion are slower, and the size is fixed;
3. Stack; eat too much and vomit; (personal understanding);
4. Queue; eat more and pull; (personal understanding);
5. Linked list; fast insertion, fast deletion, slow query;
6. Binary tree; query, insertion and deletion are fast (tree balance), and the deletion algorithm is more complicated;
7. Red-black tree (balanced tree); query, insertion and deletion are fast, and the algorithm is complex;
8.2-3-4 tree (balanced tree); query, insertion and deletion are fast, and the algorithm is complex;
9. Hash table; fast insertion, fast access by keyword, slow deletion;
10. Heap; fast insertion and deletion, fast access to the largest data item, slow access to other data;
11. Graphs; modeling the real world, some algorithms are complex and slow