The list of the most common linear structures we have in algorithmic design is just a few:
1. Arrays:
The array should be one of my most common. His storage address is continuous, that is, when we open an array, we will assign him a continuous address. Since his address is continuous, it is very fast to find the element when we know he is subscript.
2. Linked list:
The position of the elements in the list is not fixed, and each node in the list has a head pointer and a tail pointer, which connects the elements in the list so that the time to find an element is related to the position of the element. But he has an edge over space.
3. Stack:
A feature of the elements in the stack is the principle of "FIFO first". We can use a stack of plates as a metaphor, and every time we add a new dish and take a dish, we do it on top, and he has a wide range of applications.
4. Queue:
In the queue, we operate on the elements in the team head and tail respectively. The insertion of elements at the end of the team, the deletion of elements in the team head. In the graph of the problem above the use of more.
5. Heap:
Heap is a common structure to solve two-fork tree, and is an optimal structure of priority queue.
These are very basic and very important points of knowledge, so you have to master anyway. The rest of the nonsense is not much to say, I will be for each structure to do a detailed sharing, I hope that we have a lot of support, common learning common progress.
Common linear list Structure---"arrays, lists, stacks, queues, heaps"