tree: imporved bucket sort api