The Algorithm for Reversing A Sentence

Written by silver.io | Published 2020/03/03
Tech Story Tags: algorithms | software-engineering | technology | reverse-a-sentence | reverse-words-c | reverse-functions-c | increment-operators-c | time-space-complexity

TLDR The Algorithm for Reversing A Sentence is based on an array of characters “s” that “consists of sequences of characters separated by space characters” So, you are asked to “implement a function ‘reverse_words’ that reverses the order of the words in the array in the most efficient manner” The best way to solve this problem is by first reversing each of the. words in an array: The address of the first character in the. array is passed to a function that will reverse every word in the string: reverse_words().via the TL;DR App

no story

Written by silver.io | Engineering, hacking, surfing
Published by HackerNoon on 2020/03/03