An attempt at implementing the scapegoat BST. didn't quite pan out. flatten proved to be trickier than expected and still need to fix bug related to finding the actual scapegoat. for now, the root is hard coded as the scapegoat. not the most efficient, and definitely against the spirit of the algorithm, but peformance-wise isn't too far off from the target.
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.309.9376&rep=rep1&type=pdf