sequences fig quicksorting list it with the last item that is less than the pivot then partitioning is performed on the resulting two sublists the randomization done in the first step of quicksort helps to pick more random pivot value this has real consequences in the quicksort algorithmespecially when the sequence passed to quicksort has chance of being sorted already if the sequence given to quicksort is sortedor almost sortedin either ascending or descending orderthen quicksort will not achieve ( log ncomplexity in factthe worst case complexity of the algorithm is ( if the pivot chosen is the next least or greatest valuethen the partitioning will not divide the problem into to smaller sublists as occurred when was chosen as pivot for sublist in fig the algorithm will simply put one value in place and end up with one big partition of all the rest of the values if this happened each time pivot was chosen it would lead to ( complexity randomizing the list prior to quicksorting it will help to ensure that this does not happen merge sort is not affected by the choice of pivotsince no choice is necessary thereforemerge sort does not have worst case or best case to consider it will always achieve ( log ncomplexity even soquicksort performs better in practice than merge sort because the quicksort algorithm does not need to copy to new list and then back again the quicksort algorithm is the de facto standard of sorting algorithms two-dimensional sequences sometimes programmers need to represent two-dimensional sequences in program this can be done quite easily by creating list of lists the main list can represent either the columns or the rows of the matrix if the main list contains references to this copy belongs to 'acha