1. Analysis of linear storage configuration
1.1 Analysis of storage arrays
- Advantages: access to the elements by way of the subscript, fast; for an ordered array, a binary search may be used to improve the search speed
- Disadvantage: If you want to retrieve a particular value or intervening value (a certain order) will move integrally, inefficient
1.2 Analysis of the list of storage
- Advantages: have a certain degree of optimization of storage arrays (for example: Insert a node value, just to the insertion node, to link to the list, delete the efficiency is very good)
- Cons: At retrieval, efficiency is still low (to retrieve a value, we need to start from scratch node traversal)
2. The non-linear storage configuration
2.1 tree
Capable of improving data storage, read efficiency, such as using binary sort tree (the Sort Binary Tree) , to ensure that both the data retrieval speed, and also can ensure insertion data, delete, modify speed
Figure 2.1
slightly