circular buffer (basic)
model
- always contains at least one element
- values inserted to right of bar
- values popped from right of bar
pop! returns last value inserted
basic operations
- make-circular-buffer : T –> CB
- insert! : CB x T –> undefined
- remove! : CB –> T
- rotate-left! : CB –> undefined
- rotate-right! : CB –> undefined
- size : CB –> int
implementation hints
- use only a singly-linked list
- same number of cons cells as value in the buffer
- all ops are 0(1) time except for rotate-right! and size