NestedIterator

package
v0.0.0-...-b341e3b Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NestedInteger

type NestedInteger struct{}

func (*NestedInteger) Add

func (nList *NestedInteger) Add(elem NestedInteger)

Add adds `nList` to hold a nested list and adds a nested integer to it.

func (*NestedInteger) GetInteger

func (nList *NestedInteger) GetInteger() int

GetInteger returns the single integer that `nList holds, if it holds a single integer. The result is undefined if `nList` holds a nested list.

func (*NestedInteger) GetList

func (nList *NestedInteger) GetList() []*NestedInteger

GetList returns the nested list that `nList` holds, if it holds a nested list. The list length is zero if this NestedInteger holds a single integer.

func (*NestedInteger) IsInteger

func (nList *NestedInteger) IsInteger() bool

IsInteger returns `true` if `nList` holds a single integer, rather than a nested list.

func (*NestedInteger) SetInteger

func (nList *NestedInteger) SetInteger(value int)

SetInteger sets `nList` to hold a single integer.

type NestedIterator

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

func Constructor

func Constructor(nestedList []*NestedInteger) *NestedIterator

func (*NestedIterator) HasNext

func (iter *NestedIterator) HasNext() bool

func (*NestedIterator) Next

func (iter *NestedIterator) Next() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳