time and space complexities added