mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-29 20:26:07 -04:00
Update README.md
This commit is contained in:
parent
39a321a8e0
commit
802c4c9d5a
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
* queues are **first in, first out (FIFO) abstract structures** (*i.e.*, items are removed at the same order they are added) that can be implemented with two arrays or a dynamic array (linked list), as long as items are added and removed from opposite sides.
|
* queues are **first in, first out (FIFO) abstract structures** (*i.e.*, items are removed in the same order they are added) that can be implemented with two arrays or a dynamic array (linked list), as long as items are added and removed from opposite sides.
|
||||||
|
|
||||||
* queues support **enqueue** (add to one end) and **dequeue** (remove from the other end, or tail).
|
* queues support **enqueue** (add to one end) and **dequeue** (remove from the other end, or tail).
|
||||||
|
|
||||||
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
* to build a ring with a fixed size array, any of the elements could be considered as the head.
|
* to build a ring with a fixed size array, any of the elements could be considered as the head.
|
||||||
|
|
||||||
* to enqueue, you loop the queue with the tail index until find a `None` (even if it has to loop back):
|
* to enqueue, you loop the queue with the tail index until you find a `None` (even if it has to loop back):
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ class CircularQueue:
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
* another version used only one index (for `head`) and calculates the tail with the equation:
|
* another version used only one index (for `head`) and calculate the tail with the equation:
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user