|
The characteristics of the queue are: first-in first-out;
The characteristics of the single chain are: when iterating, you can only move forward, not turn back;
In the case where only the head pointer is known:
Into the pair: first traverse the single chain, find the tail pointer, time complexity O (n);
Out of right: just directly access the head pointer, time complexity O(1);
Only know that the situation of the tail pointer is the opposite of the analysis above. |
|