March 2019
Intermediate to advanced
336 pages
9h 9m
English
In the following code snippet, the NodeWithValue method of LinkedList returns the node with the property value. The list is traversed and checked to see whether the property value is equal to the parameter property:
//NodeWithValue method returns Node given parameter propertyfunc (linkedList *LinkedList) NodeWithValue(property int) *Node{ var node *Node var nodeWith *Node for node = linkedList.headNode; node != nil; node = node.nextNode { if node.property == property { nodeWith = node break; } } return nodeWith}
Read now
Unlock full access