add bucket sort func implenment && misc refine

1.bucket sort implenment
2.Code Style Clean
3.Define DEBUG flag for progress output
4.other potential errors

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