As per the title.
I have the following code which creates a binary search tree, but if I want it created and changed dynamically with user input, how would I do that if
Dario gave a good direct answer. If you want more in-depth information, there's Purely Functional Data Structures by Chris Okasaki, an entire book on the subject. I bought it myself, but sadly, I don't have the time to experiment with the ideas.