#pseudo code function(string): words <- [] # holds found words word <- "" # finds words for i from 0 to length of str: if str[i] is not " ": append str[i] to word if i is equal to length of str: append word to words else append word to words word <- "" result <- "" for i from length of words to 0: append words[i] to result return result