From 1c2b1a2f028ea2af9cc8203bdd8d63fa4d3fd475 Mon Sep 17 00:00:00 2001 From: dudaodong Date: Thu, 2 Jun 2022 22:26:26 +0800 Subject: [PATCH] docs: update Peak function comment --- datastructure/stack/arraystack.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datastructure/stack/arraystack.go b/datastructure/stack/arraystack.go index 8dd682b..3b546fd 100644 --- a/datastructure/stack/arraystack.go +++ b/datastructure/stack/arraystack.go @@ -47,7 +47,7 @@ func (s *ArrayStack[T]) Pop() (*T, error) { return &topItem, nil } -// Peak return the top element of stack then return it +// Peak return the top element of stack func (s *ArrayStack[T]) Peak() (*T, error) { if s.IsEmpty() { return nil, errors.New("stack is empty")