The section “Adding Cells at the End” gives an O(N) algorithm for adding an item at the end of a singly linked list. If you keep another variable, bottom, that points to the last cell in the list, then you can add items to the end of the list in O(1) time. Write such an algorithm. How does this complicate other algorithms that add an item at the beginning or end of the list, find an item, and remove an item? Write an algorithm for removing an item from this kind of list.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here