Sheet 3
Sheet 3
5. Write a function that moves the smallest item on a linked list pointed
by sptr to be the first node on the list.
1
6. Write a function called display() to display the contents of all nodes
within a Linked List pointed by sptr. Where, each node has a data
field containing float data.
10. Write a function called add-node to add node into a Linked List
pointed by sptr after the 6th node.
11. Write a function called delete-node to delete the 3rd node from a
Linked List.
13. Write a function that takes a link to a list as argument and returns a
link to a copy of the list (a new list that contains the same items, in
the same order).
2
14. Write a function to insert a node after the 5th node of a linked list
pointed by a start pointer called sptr.
15. Write a function to delete the 5th node from a linked list pointed by a
start pointer called sptr.