Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SinglyLL ¶
type SinglyLL struct {
Val interface{}
Next *SinglyLL
}
SinglyLL is a singly linked list of any kind of value. Type management falls to the user.
func FastShuffle ¶
FastShuffle uniformly shuffles the singly linked list in O(N) time and O(N) space. Technically, O(2N) space. First N is for slice of values, second N is for new Linked List (not done in-place and doesn't mutate input linked list).
func MemoryOptimizedShuffle ¶
MemoryOptimizedShuffle uniformly shuffles the singly linked list in O(N^2) time and O(1) space.
Click to show internal directories.
Click to hide internal directories.