Google interview question

Reverse the word order in a string.

Interview Answers

Anonymous

7 Oct 2010

Flip entire string, then flip individual words.

2

Anonymous

2 July 2019

// In java String str[]=givenString.split(" "); for(int a=str.length-1;a>=0;a--) System.out.print(str[a]+" ");

Anonymous

7 Jan 2011

Use String Tokenizer to parse words from string and subsequently push each word onto a stack. When there are no more tokens, pop the stack and concatenate back into string.

2