March 2019
Intermediate to advanced
336 pages
9h 9m
English
The main method creates an instance of a linked list, and integer properties 1, 3, 5, and 7 are added to the head of the linked list. The linked list's headNode property is printed after the elements are added:
// main methodfunc main() { var unOrderedList UnOrderedList unOrderedList = UnOrderedList{} unOrderedList.AddToHead(1) unOrderedList.AddToHead(3) unOrderedList.AddToHead(5) unOrderedList.AddToHead(7) unOrderedList.IterateList()}
Run the following command to execute the unordered_list.go file from the code bundle:
go run unordered_list.go
This is the output:

Read now
Unlock full access