March 2019
Intermediate to advanced
336 pages
9h 9m
English
The opposite method takes a node value and returns the opposite node's value. In the following code snippet, the opposite method takes the nodeValue integer as a parameter and returns the opposite node's value:
//opposite methodfunc opposite(nodeValue int) int { return 1 - nodeValue}
Read now
Unlock full access