Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v1 state

Back to all declarations

stackData

[]int

stackData holds the LIFO stack; the last pushed element is the "top".

Value

<zero>

queueData

[]int

queueData 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.

Open
OID
046747…1ca4:5
Push details

Inspect func

Pop

func() int

Pop removes and returns the top element of the LIFO stack. It panics (a cross-realm abort) if the stack is empty.

Open
OID
046747…1ca4:7
Pop details

Inspect func

Enqueue

func(n int)

Enqueue adds n to the back of the FIFO queue.

Open
OID
046747…1ca4:8
Enqueue details

Inspect func

Dequeue

func() int

Dequeue removes and returns the front element of the FIFO queue. It panics (a cross-realm abort) if the queue is empty.

Open
OID
046747…1ca4:9
Dequeue details

Inspect func

StackSize

func() int

StackSize returns the number of elements in the LIFO stack.

Open
OID
046747…1ca4:10
StackSize details

Inspect func

QueueSize

func() int

QueueSize returns the number of elements in the FIFO queue.

Open
OID
046747…1ca4:11
QueueSize details

Inspect func

renderInts

func(xs []int) string

renderInts formats a slice of ints as a space-separated list, e.g. "1 2 3".

Open
OID
046747…1ca4:12
renderInts details

Inspect func

Render

func(path string) string

Render returns a Markdown view of both structures with top/front labeled, their sizes, and a one-line explanation of LIFO vs FIFO.

Open
OID
046747…1ca4:13
Render details

Inspect func
stackData : []int =<zero>
queueData : []int =<zero>
Push : func(n int) Inspect
Pop : func() int Inspect
Enqueue : func(n int) Inspect
Dequeue : func() int Inspect
StackSize : func() int Inspect
QueueSize : func() int Inspect
renderInts : func(xs []int) string Inspect
Render : func(path string) string Inspect