<prompt> Kujenga algorithm kwa ajili ya kuandaa safu ya maneno.  <response>: One common algorithm for sorting an array of words is called the QuickSort algorithm. Here is the implementation of the algorithm for sorting an array of words:def quickSortarray: base case if lenarray 1: return array pivot arraylenarray 2 left x for x in array if x pivot middle x for x in array if x pivot right x for x in array if x pivot return quickSortleft middle quickSortrightExample usagewordArray banana, apple, grape, pineapple, pear, cherry, peachsortedWordArray quickSortwordArrayprintsortedWordArrayOutput: apple, banana, cherry, grape, peach, pear, pineappleThis algorithm uses recursion to sort the array. It first selects a pivot element from the array and then partitions the other elements into the following three sub-arrays:1. Elements that are less than the pivot2. Elements that are equal to the pivot3. Elements that are greater than the pivot The algorithm then recursively applies the same logic to the left and right sub-arrays until the base case an array of size zero or one is reached, at which point the sub-arrays are combined to form the final sorted array. 