Finished most part of quick sort, except for the relationship with tree sort