linkedlist

package
v0.0.0-...-d6c755d Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Display

func Display(head *node)

Display display linked list contents

func NewLinkedList

func NewLinkedList(data []interface{}) *node

NewLinkedList factory function

func RemoveKthNodeToTail

func RemoveKthNodeToTail(head *node, K int) (*node, error)

RemoveKthNodeToTail remove k'th node before tail traverse through the linkedlist with 2 pointers to find k-1'th node then remove the node by manipulating the pointers O(n) time and O(1) space

func Reverse

func Reverse(head *node) *node

Reverse inplace reversal traverse through one time and reverse returns new head O(n) time, O(1) space

func Size

func Size(head *node) int

Size returns the Size of the linkedlist O(n) time, O(1) space

Types

This section is empty.

Jump to

Keyboard shortcuts

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