homework 6 submission

root = add(k,x,root);
This handles the case where the root needs to change.