Documentation ¶
Index ¶
- func IsValid(s string, brackets map[rune]rune) bool
- func NewArrayStack(capacity int) *arrayStack
- type ArrayList
- func (arrayList *ArrayList) Add(index int, e interface{}) error
- func (arrayList *ArrayList) AddFirst(e interface{}) error
- func (arrayList *ArrayList) AddLast(e interface{}) error
- func (arrayList *ArrayList) Capacity() int
- func (arrayList *ArrayList) Contains(e interface{}) bool
- func (arrayList *ArrayList) Find(e interface{}) int
- func (arrayList *ArrayList) FindAll(e interface{}) (indexes []int)
- func (arrayList *ArrayList) Get(index int) interface{}
- func (arrayList *ArrayList) IsEmpty() bool
- func (arrayList *ArrayList) Remove(index int) interface{}
- func (arrayList *ArrayList) RemoveAllElement(e interface{}) bool
- func (arrayList *ArrayList) RemoveElement(e interface{}) bool
- func (arrayList *ArrayList) RemoveFirst() interface{}
- func (arrayList *ArrayList) RemoveLast() interface{}
- func (arrayList *ArrayList) Set(index int, e interface{})
- func (arrayList *ArrayList) Size() int
- func (arrayList *ArrayList) String() string
- func (arrayList *ArrayList) Swap(i int, j int) error
- type IStack
- type LinkedList
- func (linkedList *LinkedList) Add(index int, e interface{}) error
- func (linkedList *LinkedList) AddFirst(e interface{})
- func (linkedList *LinkedList) AddLast(e interface{}) error
- func (linkedList *LinkedList) Contains(e interface{}) bool
- func (linkedList *LinkedList) Get(index int) (interface{}, error)
- func (linkedList *LinkedList) GetFirst() (interface{}, error)
- func (linkedList *LinkedList) GetLast() (interface{}, error)
- func (linkedList *LinkedList) Head() *Node
- func (linkedList *LinkedList) IsEmpty() bool
- func (linkedList *LinkedList) Remove(index int) (interface{}, error)
- func (linkedList *LinkedList) RemoveElement(e interface{})
- func (linkedList *LinkedList) RemoveFirst() interface{}
- func (linkedList *LinkedList) Set(index int, e interface{}) error
- func (linkedList *LinkedList) Size() int
- func (linkedList *LinkedList) String() string
- type LoopLinkedList
- func (l *LoopLinkedList) Add(index int, e interface{})
- func (l *LoopLinkedList) AddFirst(e interface{})
- func (l *LoopLinkedList) AddLast(e interface{})
- func (l *LoopLinkedList) Contains(e interface{}) bool
- func (l *LoopLinkedList) Get(index int) interface{}
- func (l *LoopLinkedList) GetFirst() interface{}
- func (l *LoopLinkedList) GetLast() interface{}
- func (l *LoopLinkedList) IsEmpty() bool
- func (l *LoopLinkedList) Remove(index int) interface{}
- func (l *LoopLinkedList) RemoveFirst() interface{}
- func (l *LoopLinkedList) RemoveLast() interface{}
- func (l *LoopLinkedList) Set(index int, e interface{})
- func (l *LoopLinkedList) Size() int
- func (l *LoopLinkedList) String() string
- type LoopNode
- type Node
- type TwoWayLinkedList
- func (l *TwoWayLinkedList) Add(index int, e interface{})
- func (l *TwoWayLinkedList) AddFirst(e interface{})
- func (l *TwoWayLinkedList) AddLast(e interface{})
- func (l *TwoWayLinkedList) Contains(e interface{}) bool
- func (l *TwoWayLinkedList) Get(index int) interface{}
- func (l *TwoWayLinkedList) GetFirst() interface{}
- func (l *TwoWayLinkedList) GetLast() interface{}
- func (l *TwoWayLinkedList) IsEmpty() bool
- func (l *TwoWayLinkedList) Remove(index int) interface{}
- func (l *TwoWayLinkedList) RemoveFirst() interface{}
- func (l *TwoWayLinkedList) RemoveLast() interface{}
- func (l *TwoWayLinkedList) Set(index int, e interface{})
- func (l *TwoWayLinkedList) Size() int
- func (l *TwoWayLinkedList) String() string
- type TwoWayNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewArrayStack ¶
func NewArrayStack(capacity int) *arrayStack
Types ¶
type ArrayList ¶
type ArrayList struct {
// contains filtered or unexported fields
}
func (*ArrayList) RemoveAllElement ¶
从数组中删除所有元素 e
func (*ArrayList) RemoveElement ¶
从数组中删除一个元素 e
func (*ArrayList) RemoveFirst ¶
func (arrayList *ArrayList) RemoveFirst() interface{}
从数组中删除第一个元素,返回删除的元素
func (*ArrayList) RemoveLast ¶
func (arrayList *ArrayList) RemoveLast() interface{}
从数组中删除最后一个元素,返回删除的元素
type LinkedList ¶
type LinkedList struct {
// contains filtered or unexported fields
}
func NewLinkedList ¶
func NewLinkedList() *LinkedList
func (*LinkedList) Add ¶
func (linkedList *LinkedList) Add(index int, e interface{}) error
在链表的index(0-based)位置添加新的元素e
func (*LinkedList) AddLast ¶
func (linkedList *LinkedList) AddLast(e interface{}) error
在链表末尾添加新的元素e
func (*LinkedList) Contains ¶
func (linkedList *LinkedList) Contains(e interface{}) bool
查找链表是否存在元素e
func (*LinkedList) Get ¶
func (linkedList *LinkedList) Get(index int) (interface{}, error)
获得链表的第index(0-based)个位置的元素
func (*LinkedList) GetFirst ¶
func (linkedList *LinkedList) GetFirst() (interface{}, error)
获得链表的第一个元素
func (*LinkedList) GetLast ¶
func (linkedList *LinkedList) GetLast() (interface{}, error)
获得链表的最后一个元素
func (*LinkedList) Head ¶
func (linkedList *LinkedList) Head() *Node
func (*LinkedList) Remove ¶
func (linkedList *LinkedList) Remove(index int) (interface{}, error)
从链表中删除index(0-based)位置的元素,返回删除的元素
func (*LinkedList) RemoveElement ¶
func (linkedList *LinkedList) RemoveElement(e interface{})
从链表中删除元素e
func (*LinkedList) RemoveFirst ¶
func (linkedList *LinkedList) RemoveFirst() interface{}
func (*LinkedList) Set ¶
func (linkedList *LinkedList) Set(index int, e interface{}) error
修改链表的第index(0-based)个位置的元素为e
func (*LinkedList) String ¶
func (linkedList *LinkedList) String() string
type LoopLinkedList ¶
type LoopLinkedList struct {
// contains filtered or unexported fields
}
func NewLoopLinkedList ¶
func NewLoopLinkedList() *LoopLinkedList
func (*LoopLinkedList) Add ¶
func (l *LoopLinkedList) Add(index int, e interface{})
func (*LoopLinkedList) AddFirst ¶
func (l *LoopLinkedList) AddFirst(e interface{})
func (*LoopLinkedList) AddLast ¶
func (l *LoopLinkedList) AddLast(e interface{})
func (*LoopLinkedList) Contains ¶
func (l *LoopLinkedList) Contains(e interface{}) bool
func (*LoopLinkedList) Get ¶
func (l *LoopLinkedList) Get(index int) interface{}
func (*LoopLinkedList) GetFirst ¶
func (l *LoopLinkedList) GetFirst() interface{}
func (*LoopLinkedList) GetLast ¶
func (l *LoopLinkedList) GetLast() interface{}
func (*LoopLinkedList) IsEmpty ¶
func (l *LoopLinkedList) IsEmpty() bool
func (*LoopLinkedList) Remove ¶
func (l *LoopLinkedList) Remove(index int) interface{}
func (*LoopLinkedList) RemoveFirst ¶
func (l *LoopLinkedList) RemoveFirst() interface{}
func (*LoopLinkedList) RemoveLast ¶
func (l *LoopLinkedList) RemoveLast() interface{}
func (*LoopLinkedList) Set ¶
func (l *LoopLinkedList) Set(index int, e interface{})
func (*LoopLinkedList) Size ¶
func (l *LoopLinkedList) Size() int
func (*LoopLinkedList) String ¶
func (l *LoopLinkedList) String() string
type TwoWayLinkedList ¶
type TwoWayLinkedList struct {
// contains filtered or unexported fields
}
func NewTwoWayLinkedList ¶
func NewTwoWayLinkedList() *TwoWayLinkedList
func (*TwoWayLinkedList) Add ¶
func (l *TwoWayLinkedList) Add(index int, e interface{})
func (*TwoWayLinkedList) AddFirst ¶
func (l *TwoWayLinkedList) AddFirst(e interface{})
func (*TwoWayLinkedList) AddLast ¶
func (l *TwoWayLinkedList) AddLast(e interface{})
func (*TwoWayLinkedList) Contains ¶
func (l *TwoWayLinkedList) Contains(e interface{}) bool
func (*TwoWayLinkedList) Get ¶
func (l *TwoWayLinkedList) Get(index int) interface{}
func (*TwoWayLinkedList) GetFirst ¶
func (l *TwoWayLinkedList) GetFirst() interface{}
func (*TwoWayLinkedList) GetLast ¶
func (l *TwoWayLinkedList) GetLast() interface{}
func (*TwoWayLinkedList) IsEmpty ¶
func (l *TwoWayLinkedList) IsEmpty() bool
func (*TwoWayLinkedList) Remove ¶
func (l *TwoWayLinkedList) Remove(index int) interface{}
func (*TwoWayLinkedList) RemoveFirst ¶
func (l *TwoWayLinkedList) RemoveFirst() interface{}
func (*TwoWayLinkedList) RemoveLast ¶
func (l *TwoWayLinkedList) RemoveLast() interface{}
func (*TwoWayLinkedList) Set ¶
func (l *TwoWayLinkedList) Set(index int, e interface{})
func (*TwoWayLinkedList) Size ¶
func (l *TwoWayLinkedList) Size() int
func (*TwoWayLinkedList) String ¶
func (l *TwoWayLinkedList) String() string
type TwoWayNode ¶
type TwoWayNode struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.