add bucket sort func implenment && misc refine

1.bucket sort implenment
2.Code Style Clean
3.Define DEBUG flag to control  whether dump progress
4.other potential errors

Signed-off-by: Mingming Zhang <fishtown.mm@gmail.com>