Foundational theory for optimal decision tree problems. II. Optimal hypersurface decision tree algorithm