list

package
v0.0.0-...-986f64f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

本包提供链表实现

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Element

type Element struct {
	NextOne *Element
	// contains filtered or unexported fields
}

链表中某一元素

func (*Element) Get

func (e *Element) Get() (interface{}, error)

func (*Element) Next

func (e *Element) Next() *Element

func (*Element) Prev

func (e *Element) Prev() *Element

func (*Element) Set

func (e *Element) Set(x interface{}) error

func (*Element) String

func (e *Element) String() string

func (*Element) Tsget

func (e *Element) Tsget() (x interface{}, err error)

func (*Element) Tsnext

func (e *Element) Tsnext() (x *Element)

func (*Element) Tsprev

func (e *Element) Tsprev() (x *Element)

func (*Element) Tsset

func (e *Element) Tsset(x interface{}) error

type SingleLinkedList

type SingleLinkedList struct {
	// contains filtered or unexported fields
}

单链表的实现

type Slist

type Slist = SingleLinkedList

单链表的实现

func NewSlist

func NewSlist() Slist

创建单链表

func (*Slist) Get

func (s *Slist) Get(size uint64) (*Element, error)

func (*Slist) Len

func (s *Slist) Len() uint64

func (*Slist) Lnsert

func (s *Slist) Lnsert(x *Element) error

func (*Slist) Remove

func (s *Slist) Remove() error

func (*Slist) String

func (s *Slist) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL