A Neat Linked Queue with the Rear Sentinel

05/17/2021
by   Xie Xie, et al.
0

We introduce a very simple queue implementation with the singly linked list. With the help of the rear sentinel instead of the traditional header node, we avoid additional check steps in the pop operation. The essence of this representation is the half-opened pointer interval, which can guarantee the uniform treatment even in the empty queue case. We also present the variants of linked queue, circularly linked queue and lazy circularly linked queue, which can also be used to implement stack and improve the time performance in some special cases.

READ FULL TEXT

Please sign up or login with your details

Forgot password? Click here to reset