Optimal alphabetic binary tree for a nonregular cost function