Categories
interview

Reverse Words in a String – Java

Using a Stack
Uses O(n) memory and time.

Efficient Solution

Memory O(1) and O(n) time.

Using built-in java methods