14.7 Enumerate Numbers of the Form a+b*sqrt(2)


#1

Hi:

Does anyone know what the interface for the RBTree() is? I was not able to find it in the Python documentation: https://pypi.org/project/bintrees/.

Also, what does it mean for the candidates[Number(next_smallest.a+1,next_smallest.b)] = None mean?
I know this is constructing the next node, but what does equaling it to None mean?

Thanks!


#2

You can check “Methods” part where listed the APIs.

Since bintrees is a key-value pair structure and what we are only interested in is key, so we just set value to None as a dont-care way.


#3

Ok thank you very much!