So i have traversed my tree and found the answer 'answ3'. Now i have added a new question and a new answer.I want to insert that newQuestion to the leaf where ans3 is/was.

I have found the answ3 so i was thinking of doing a search through my tree for that leaf. Then i need to replace that leaf with my new node which i am stumped at.So it's essentially an insert function but I don't know how to go about it. Can I step through the tree and then cons or append it when i reach the right spot?

You could do a doubly linked list - that way finding the parent of the leaf becomes trivial, but another, perhaps simpler way, if all nodes are unique would be to have a hash-map alongisde the list, which would contain all nodes in the format key = child, value = parent.

Wvxvw assumes you found answ3 only. It seems like you have done search prior to your insert? If you changed your search function to include the parent the insert would be trivial. You could return the parent as a second return value in your search with (values ans ans-parent) and do search for update with multiple-value-bind.. OR you could make a function to traverse the tree again to return the parent (assuming the extra search has little performance impact).No need to do messy doubly linked lists unless. You absolutely need to