March 2019
Intermediate to advanced
336 pages
9h 9m
English
The IterateList method of the LinkedList class iterates from the headNode property and prints the property of the current head node. The iteration happens with the head node moves to nextNode of the headNode property until the current node is no longer equal to nil. The following code shows the IterateList method of the LinkedList class:
//IterateList method iterates over LinkedListfunc (linkedList *LinkedList) IterateList() { var node *Node for node = linkedList.headNode; node != nil; node = node.nextNode { fmt.Println(node.property) }}
Read now
Unlock full access