Correction to time and space complexity.