[Refactor] the BST and RBT with an interface.

Now we use an interface to represent dynamic sets.