Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MyLinkedList ¶
type MyLinkedList struct {
// contains filtered or unexported fields
}
func (*MyLinkedList) AddAtHead ¶
func (this *MyLinkedList) AddAtHead(val int)
* Add a node of value val before the first element of the linked list. After the insertion, the new node will be the first node of the linked list.
func (*MyLinkedList) AddAtIndex ¶
func (this *MyLinkedList) AddAtIndex(index int, val int)
* Add a node of value val before the index-th node in the linked list. If index equals to the length of linked list, the node will be appended to the end of linked list. If index is greater than the length, the node will not be inserted.
func (*MyLinkedList) AddAtTail ¶
func (this *MyLinkedList) AddAtTail(val int)
* Append a node of value val to the last element of the linked list.
func (*MyLinkedList) DeleteAtIndex ¶
func (this *MyLinkedList) DeleteAtIndex(index int)
* Delete the index-th node in the linked list, if the index is valid.
func (*MyLinkedList) Get ¶
func (this *MyLinkedList) Get(index int) int
* Get the value of the index-th node in the linked list. If the index is invalid, return -1.
func (*MyLinkedList) String ¶
func (this *MyLinkedList) String() string
Click to show internal directories.
Click to hide internal directories.