linked

package
v0.0.0-...-8d3c4b6 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MyLinkedList

type MyLinkedList struct {
	Head *utils.ListNode
	N    int
}

MyLinkedList wraps utils.ListNode

func Constructor

func Constructor() *MyLinkedList

Constructor creates MyLinkedList

func (*MyLinkedList) AddAtHead

func (ll *MyLinkedList) AddAtHead(val int)

AddAtHead add a new head

func (*MyLinkedList) AddAtIndex

func (ll *MyLinkedList) AddAtIndex(index int, val int)

AddAtIndex at a new node at index with val, time complelxity O(N)

func (*MyLinkedList) AddAtTail

func (ll *MyLinkedList) AddAtTail(val int)

AddAtTail add a new node at the end

func (*MyLinkedList) DeleteAtIndex

func (ll *MyLinkedList) DeleteAtIndex(index int)

DeleteAtIndex delete a node at index

func (*MyLinkedList) Get

func (ll *MyLinkedList) Get(index int) int

Get returns the ith node'value

func (*MyLinkedList) String

func (ll *MyLinkedList) String() string

Jump to

Keyboard shortcuts

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