Skip to content

Commit

Permalink
Update stack.go
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzotinfena committed Apr 17, 2024
1 parent 9972f30 commit 0951b20
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions collections/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ func NewStack[T any]() *Stack[T] {
}
}

func (s *Stack[T]) Len() int { return s.l.Len() }
func (s *Stack[T]) Len() int { return s.l.Len() }

func (s *Stack[T]) Push(value T) { s.l.InsertFirst(value) }
func (s *Stack[T]) Push(value T) { s.l.InsertFirst(value) }

func (s *Stack[T]) Pop() T { return s.l.RemoveFirst() }
func (s *Stack[T]) Pop() T { return s.l.RemoveFirst() }

func (s *Stack[T]) Preview() T { return s.l.First() }
func (s *Stack[T]) Preview() T { return s.l.First() }

func (s Stack[T]) String() string { return s.l.String() }

0 comments on commit 0951b20

Please sign in to comment.