linkedlist

package
v0.0.0-...-b5d690a Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

linkedlist 包为 Item 类型的元素创建一个 ItemLinkedList 链表

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item generic.Type

type ItemLinkedList

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

func (*ItemLinkedList) Append

func (list *ItemLinkedList) Append(t Item)

在链表结尾追加元素

func (*ItemLinkedList) Head

func (list *ItemLinkedList) Head() *Node

获取链表的头结点

func (*ItemLinkedList) IndexOf

func (list *ItemLinkedList) IndexOf(t Item) int

获取指定元素在链表中的索引

func (*ItemLinkedList) Insert

func (list *ItemLinkedList) Insert(i int, t Item) error

在链表指定位置插入指定元素

func (*ItemLinkedList) IsEmpty

func (list *ItemLinkedList) IsEmpty() bool

检查链表是否为空

func (*ItemLinkedList) RemoveAt

func (list *ItemLinkedList) RemoveAt(i int) (*Item, error)

删除指定位置的元素

func (*ItemLinkedList) Size

func (list *ItemLinkedList) Size() int

获取链表的长度

func (*ItemLinkedList) String

func (list *ItemLinkedList) String()

格式化打印链表

type Node

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

Jump to

Keyboard shortcuts

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