stack

package
v0.0.44 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stack

type Stack struct {
	// contains filtered or unexported fields
}

Stack implements lock-free freelist based stack.

Example
s := New()

s.Push(1)
s.Push(2)
s.Push(3)

fmt.Println(s.Pop())
fmt.Println(s.Pop())
fmt.Println(s.Pop())
Output:

3
2
1

func New

func New() *Stack

New creates a new lock-free queue.

func (*Stack) Pop

func (s *Stack) Pop() interface{}

Pop pops value from the top of the stack.

func (*Stack) Push

func (s *Stack) Push(v interface{})

Push pushes a value on top of the stack.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL