Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Stack ¶
type Stack[TValue any] []TValue
Stack represents a last-in-first-out (LIFO) collection of items. It can be used to manage a set of elements with push and pop operations.
func MakeStack ¶
MakeStack creates and returns a new Stack initialized with the provided initial values. Useful for algorithm implementations needing LIFO structures.
func (*Stack[TValue]) Any ¶
Any determines if the stack contains at least one element, indicating it is not empty.
func (*Stack[TValue]) IsEmpty ¶
IsEmpty checks whether the stack is empty, which can help determine if there are any elements left to process.
Click to show internal directories.
Click to hide internal directories.