Yes, you can modify the sorting algorithm to sort the string in descending order. Simply change the comparison condition in the sorting algorithm from > to <.