14.7 enumerate numbers of the form a + b*sqrt(2)



I have a question on this problem.

In your BST implementation, you explained that adding elements can lead to duplication. But in the code you provided, there’s nothing related to “deduplication.” Do you assume that your BST insertion will eliminate duplicated insertions?



Yes, I think in C++ and Java, their BST will eliminate those automatically.