func leftToRightDFS(head *node, bitNeighbourAddress [32]bool, pathPosition int) (bool, [32]bool) {

	if head == nil {
		return true, rightPadBitAddress(bitNeighbourAddress, pathPosition, false)
	}

	//Got to the leaf
	if head.leftChild() == nil && head.rightChild() == nil {
		return false, [32]bool{}
	}

	leftHead := head.leftChild()

	foundFlag, suggestedAddressBits := leftToRightDFS(leftHead, bitNeighbourAddress, pathPosition+1)
	if foundFlag {
		return foundFlag, suggestedAddressBits
	}

	rightHead := head.rightChild()

	foundFlag, suggestedAddressBits = leftToRightDFS(rightHead, bitNeighbourAddress, pathPosition+1)
	if foundFlag {
		return foundFlag, suggestedAddressBits
	}

	return false, [32]bool{}

}
//Implements a left to right DFS, stopping when it finds a new address
Implements a left to right DFS, stopping when it finds a new address
// Implements a left to right DFS stopping when it finds a new address
func leftToRightDFS(head *node, bitNeighbourAddress [32]bool, pathPosition int) (bool, [32]bool) {
	if head == nil {
		return true, rightPadBitAddress(bitNeighbourAddress, pathPosition, false)
	}
	if head.leftChild() == nil && head.rightChild() == nil {
		return false, [32]bool{}
	}
	leftHead := head.leftChild()
	foundFlag, suggestedAddressBits := leftToRightDFS(leftHead, bitNeighbourAddress, pathPosition+1)
	if foundFlag {
		return foundFlag, suggestedAddressBits
	}
	rightHead := head.rightChild()
	foundFlag, suggestedAddressBits = leftToRightDFS(rightHead, bitNeighbourAddress, pathPosition+1)
	if foundFlag {
		return foundFlag, suggestedAddressBits
	}
	return false, [32]bool{}
}
func leftToRightDFS ( head * node , bitNeighbourAddress [ 32 ] bool , pathPosition int ) ( bool , [ 32 ] bool ) { if head == nil { return true , rightPadBitAddress ( bitNeighbourAddress , pathPosition , false ) } if head . leftChild ( ) == nil && head . rightChild ( ) == nil { return false , [ 32 ] bool { } } leftHead := head . leftChild ( ) foundFlag , suggestedAddressBits := leftToRightDFS ( leftHead , bitNeighbourAddress , pathPosition + 1 ) if foundFlag { return foundFlag , suggestedAddressBits } rightHead := head . rightChild ( ) foundFlag , suggestedAddressBits = leftToRightDFS ( rightHead , bitNeighbourAddress , pathPosition + 1 ) if foundFlag { return foundFlag , suggestedAddressBits } return false , [ 32 ] bool { } }
Implements a left to right DFS, stopping when it finds a new address
Implements a left to right DFS stopping when it finds a new address
//Got to the leaf