Documentation ¶
Index ¶
- type LinkedList
- func (list *LinkedList) Add(val interface{})
- func (list *LinkedList) Contains(val interface{}) bool
- func (list *LinkedList) ForEach(consumer func(int, interface{}) bool)
- func (list *LinkedList) Get(index int) (val interface{})
- func (list *LinkedList) Insert(index int, val interface{})
- func (list *LinkedList) Len() int
- func (list *LinkedList) Range(start, stop int) []interface{}
- func (list *LinkedList) Remove(index int) (val interface{})
- func (list *LinkedList) RemoveAllByVal(val interface{}) int
- func (list *LinkedList) RemoveByVal(val interface{}, count int) int
- func (list *LinkedList) RemoveLast() (val interface{})
- func (list *LinkedList) ReverseRemoveByVal(val interface{}, count int) int
- func (list *LinkedList) Set(index int, val interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LinkedList ¶
type LinkedList struct {
// contains filtered or unexported fields
}
LinkedList 双向链表
func Make ¶
func Make(vals ...interface{}) *LinkedList
func (*LinkedList) Add ¶
func (list *LinkedList) Add(val interface{})
func (*LinkedList) Contains ¶
func (list *LinkedList) Contains(val interface{}) bool
func (*LinkedList) ForEach ¶
func (list *LinkedList) ForEach(consumer func(int, interface{}) bool)
ForEach 遍历链表中的每一个元素
func (*LinkedList) Get ¶
func (list *LinkedList) Get(index int) (val interface{})
func (*LinkedList) Insert ¶
func (list *LinkedList) Insert(index int, val interface{})
func (*LinkedList) Len ¶
func (list *LinkedList) Len() int
func (*LinkedList) Range ¶
func (list *LinkedList) Range(start, stop int) []interface{}
func (*LinkedList) Remove ¶
func (list *LinkedList) Remove(index int) (val interface{})
func (*LinkedList) RemoveAllByVal ¶
func (list *LinkedList) RemoveAllByVal(val interface{}) int
func (*LinkedList) RemoveByVal ¶
func (list *LinkedList) RemoveByVal(val interface{}, count int) int
RemoveByVal 从前往后遍历比较并移除指定数量的节点
func (*LinkedList) RemoveLast ¶
func (list *LinkedList) RemoveLast() (val interface{})
func (*LinkedList) ReverseRemoveByVal ¶
func (list *LinkedList) ReverseRemoveByVal(val interface{}, count int) int
ReverseRemoveByVal 从后往前遍历比较并移除指定数量的节点
func (*LinkedList) Set ¶
func (list *LinkedList) Set(index int, val interface{})
Click to show internal directories.
Click to hide internal directories.