The bintrees package provides a C implementation of AVL trees, FastAVLTree. If the aim is to write everything from scratch as an academic exercise, that's understandable -- but is there a practical reason not to use it?
Hey @kjgd , sorry for the late response!
It started out as an academic excercise, that's why everything was initially written from scratch. However, this is no longer the case, so a better implementation than what I currently have is certainly favorable!