I want to randomly choose one node with equal probability to choose the root or a leaf. Do you know a quick way to do this?
I was thinking I could either generate a vector of NODE** that contains all nodes and then choose one, or iterate through the tree and approximate the probability to choose a node according to its size. Neither seems very efficient though.