Implemented Quicksort and mergesort