Consider the recursive method given in Segment 9.21 that displays the contents of a chain of linked nodes in backward order. Also consider the recursive method described in Exercise 5 that displays the contents of an array in backward order.
a. What is the time complexity of each of these two methods, and how do they compare?
b. Write an iterative method that displays the contents of a chain of linked nodes in backward order. What is this method’s time complexity, and how does it compare to the complexities that you computed in Part a?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here