March 2019
Intermediate to advanced
336 pages
9h 9m
English
The MoveOnestep method moves the element one step forward in the circular queue. The MoveOneStep method takes the element parameter of the interface type and moves the head node to position two after setting the element as the head node:
//MoveOneStep methodfunc (circularQueue *CircularQueue) MoveOneStep() (element interface{}) { if circularQueue.IsUnUsed() { return nil } element = circularQueue.nodes[circularQueue.head] circularQueue.head = (circularQueue.head + 1) % circularQueue.size return}
Read now
Unlock full access