stackData
[]intstackData holds the LIFO stack; the last pushed element is the "top".
Value
<zero>
queueData
[]intqueueData holds the FIFO queue; the oldest enqueued element is the "front".
Value
<zero>
Push
func(n int)Push adds n to the top of the LIFO stack.
- OID
- 046747…1ca4:5
Push details
Pop
func() intPop removes and returns the top element of the LIFO stack. It panics (a cross-realm abort) if the stack is empty.
- OID
- 046747…1ca4:7
Pop details
Enqueue
func(n int)Enqueue adds n to the back of the FIFO queue.
- OID
- 046747…1ca4:8
Enqueue details
Dequeue
func() intDequeue removes and returns the front element of the FIFO queue. It panics (a cross-realm abort) if the queue is empty.
- OID
- 046747…1ca4:9
Dequeue details
StackSize
func() intStackSize returns the number of elements in the LIFO stack.
- OID
- 046747…1ca4:10
StackSize details
QueueSize
func() intQueueSize returns the number of elements in the FIFO queue.
- OID
- 046747…1ca4:11
QueueSize details
renderInts
func(xs []int) stringrenderInts formats a slice of ints as a space-separated list, e.g. "1 2 3".
- OID
- 046747…1ca4:12
renderInts details
Render
func(path string) stringRender returns a Markdown view of both structures with top/front labeled, their sizes, and a one-line explanation of LIFO vs FIFO.
- OID
- 046747…1ca4:13