One day a week, take the software designer test with the group of brothers 01

data structure

Linear table Insert q node after p node in
Insert picture description here
single linked list q->next = p-next; p->next = q; delete p node head->next = p->next; free§;
Insert picture description here





Circular linked list
Insert picture description here
Double linked list
Insert picture description here
Delete p node
p->next->front =p->front;
p->front->next=p->-next;
free§;
Insert q node after p node
q->next = p- > Next;
Q-> Front = P;
p-> next-> Q = Front;
p-> Next = Q;
sequential storage, chain stores performance comparison
Insert picture description here
stack
same stack sequence, the sequence may differ from the stack (the side Edge out)
pointer to the top of the stack

Queue
head and tail pointers
To judge whether the circular queue is empty or full
Sacrifice a space, (tail+1)% size=head% size, queue full
tail=head, queue empty

Guess you like

Origin blog.csdn.net/puyu2017/article/details/106201880