linked_stack_test

2022-12-14 浏览 (728)

linked_stack_test.go 源码

package linked_stack

import (
	"fmt"
	"testing"
)

func TestLinkedStack(t *testing.T) {
	stack := NewLinkedStack()
	stack.Push(1)
	stack.Push(4)
	stack.Push(2)
	stack.Push(7)

	pop, _ := stack.Pop()
	fmt.Println(pop)

	peek, _ := stack.Peek()
	fmt.Println(peek)

	fmt.Println(stack.Size())
	stack.PrintData()
}

你可能感兴趣的文章

linked_stack

  • 所属分类: 后端技术
  • 本文标签: 技术
  • 版权声明: 本文链接 https://seaxiang.com/blog/f52da10a5f254cfc96d28519bfd9fdf7