Moving the global functions from Binary Tree to Algorithms