CSC 185 Lab - 11
Linked Lists • Practice designing the data structure – linked list, adding a node to a linked list, displaying a linked list. • Create a linked list with an element whose data value is ‘1’. Ask the user an option to add nodes to the existing linked list. When user keeps entering new data, always add the elements/nodes so that the data in the linked list is always in a sorted order.
– Ex: I have data element ‘1’ in the linked list. Let us say user enters element ‘0’. Then you should add the node before the node with data element ‘1’. Similarly if the new data element is ‘3’, add it after node with data element ‘1’. Thus maintaining the linked list always in a sorted order.