apply data structure to implement sort algorithms