MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / IsEmpty

Method IsEmpty

structure/stack/stackarray.go:41–43  ·  view source on GitHub ↗

IsEmpty returns true if the stack is empty, false otherwise.

()

Source from the content-addressed store, hash-verified

39
40// IsEmpty returns true if the stack is empty, false otherwise.
41func (s *Array[T]) IsEmpty() bool {
42 return len(s.elements) == 0
43}
44
45// Pop removes and returns the top element from the stack.
46func (s *Array[T]) Pop() T {

Callers 2

PeekMethod · 0.95
PopMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected