Optimal Binary Search Tree C Code