insertremove

package
v0.0.0-...-27d64f3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package insertremove contains the "Insert and Remove" exercise implementations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InserterRemover

type InserterRemover interface {
	Insert(n int) error
	Remove()

	// only for testing purposes
	Values() []int
}

declare an interface to ease testing ang benchmarking

type ListImpl

type ListImpl struct {
	list.List
}

List implementation

func NewListImpl

func NewListImpl() *ListImpl

func (*ListImpl) Insert

func (l *ListImpl) Insert(n int) error

func (*ListImpl) Remove

func (l *ListImpl) Remove()

func (*ListImpl) Values

func (l *ListImpl) Values() []int

type SliceImpl

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

Slice implementation

func NewSliceImpl

func NewSliceImpl() *SliceImpl

func (*SliceImpl) Insert

func (s *SliceImpl) Insert(n int) error

func (*SliceImpl) Remove

func (s *SliceImpl) Remove()

func (*SliceImpl) Values

func (s *SliceImpl) Values() []int

Jump to

Keyboard shortcuts

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