I couldn't understand this algorithm. Please help me to do this.

Answer:
This is bubble sort, to alphabetize an array of strings.
Explanation:
The algorithm walks through the array, and compares one value to the next. If the 'current' value is larger than the next, it swaps them, and starts all over.
So a value that lexographically is first to be alphabetized, will 'bubble' all the way to the top.