Linked lists

Consider: https://replit.com/@JimSkon/SimpleLinkedListatend#main.cpp

Fork and add code to do each of the after 5 numbers have been entered.

  1. Write code to insert a new node at the head with “44”.
    You will need to use new to create a new node, then insert it in the proper place.
    Then display the list.
  2. Write code to insert a “10” between the second and third element. Do not use a loop.
  3. Write code to add a “42” after the 4 node. Use a loop.
  4. Write code to add “999” after the last node.
  5. Write code to delete the first node.
  6. Write code to delete the 3rd node.
  7. Write code to delete the last node.
  8. Write code to delete the nth node.
  9. Write code to allow a node value to be entered, and delete that node.

Fork the following: https://replit.com/@JimSkon/SimpleLinkedListSorted#main.cpp

  1. Change the code to add in the opposite order.
  2. Change the code to be doubly linked.
  3. Write a function “displayBackwards” to list the reverse order.
  4. Write code to remove the 3rd element.
  5. Write code to remove the first element.
  6. Write code to remove the last element.
  7. Write code to clear the list.
Scroll to Top