in code fragment we give pseudo-code description of the quick-sort algorithm that is efficient for sequences implemented as arrays or linked lists the algorithm follows the template for quick-sort given aboveadding the detail of scanning the input sequence backwards to divide it into the lists leand of elements that are respectively less thanequal toand greater than the pivot we perform this scan backwardssince removing the last element in sequence is constant-time operation independent of whether the sequence is implemented as an array or linked list we then recur on the and listsand copy the sorted lists leand back to we perform this latter set of copies in the forward direction