Documentation
¶
Index ¶
- type CompareFn
- type DLink
- func (l *DLink[T]) AddNode(n int64)
- func (l *DLink[T]) Cap() int64
- func (l *DLink[T]) DelNode(n int64) error
- func (l *DLink[T]) Len() int64
- func (l *DLink[T]) Peek() T
- func (l *DLink[T]) Pull() (v T)
- func (l *DLink[T]) Push(value T)
- func (l *DLink[T]) Range() (out []T)
- func (l *DLink[T]) Size(size int64) error
- type Node
- type OnewayLinkInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DLink ¶
type OnewayLinkInterface ¶ added in v0.1.10
type OnewayLinkInterface[T any] interface { Next() OnewayLinkInterface[T] SetNext(OnewayLinkInterface[T]) Val() T }
OnewayLinkInterface 链表节点
func MergeSort ¶ added in v0.1.10
func MergeSort[T any](head OnewayLinkInterface[T], less CompareFn[T]) OnewayLinkInterface[T]
MergeSort 对链表做稳定排序,返回排好序的新表头
Click to show internal directories.
Click to hide internal directories.