Space and Time Complexity of an Algorithm