def get_next_address(previous_address: int, both_addresses_xored: int) -> int:
	"""
	Returns the next address given the previous address and the 
	xor of previous and next addresses
	:param previous_address: The address of the previous node
	:param both_addresses_xored: The XOR of the previous and the next node
	:return: The address of the next node
	"""
	# For the root node, the previous address is None and therefore the next
	# address is stored directly in both_addresses_xored
	if previous_address is None:
		next_address = both_addresses_xored
	# Otherwise we XOR the two as per the above approach
	else:
		next_address = previous_address ^ both_addresses_xored
	return next_address