doublelinkedlist

package
v0.0.0-...-a261c41 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LinkedList

type LinkedList[T comparable] struct {
	// contains filtered or unexported fields
}

func NewDoubleLinkedList

func NewDoubleLinkedList[T comparable]() *LinkedList[T]

func (*LinkedList[T]) Add

func (list *LinkedList[T]) Add(item T)

将指定元素添加到列表末尾。

func (*LinkedList[T]) AddAt

func (list *LinkedList[T]) AddAt(index int, item T)

将指定元素插入到列表的指定位置。

func (*LinkedList[T]) Get

func (list *LinkedList[T]) Get(index int) T

返回列表中指定位置的元素。

func (*LinkedList[T]) Remove

func (list *LinkedList[T]) Remove(index int) bool

删除列表中指定位置的元素。

func (*LinkedList[T]) Set

func (list *LinkedList[T]) Set(index int, item T)

将列表中指定位置的元素替换为指定元素。

func (*LinkedList[T]) Size

func (list *LinkedList[T]) Size() int

返回列表的大小。

func (*LinkedList[T]) String

func (list *LinkedList[T]) String() string

type Node

type Node[T comparable] struct {
	// contains filtered or unexported fields
}

type Set

type Set[T comparable] struct {
	// contains filtered or unexported fields
}

func (*Set[T]) Add

func (set *Set[T]) Add(item T)

向集合中添加元素。

func (*Set[T]) Contains

func (set *Set[T]) Contains(item T) bool

检查集合中是否包含指定元素。

func (*Set[T]) Remove

func (set *Set[T]) Remove(item T) bool

从集合中删除元素。

func (*Set[T]) Size

func (set *Set[T]) Size() int

返回集合中的元素数量。

func (*Set[T]) ToSlice

func (set *Set[T]) ToSlice() []T

将集合转换为切片。

Jump to

Keyboard shortcuts

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