CS301‐ Data Structures
Assignment No. 01
SEMESTER Spring 2013
Total Marks: 20
Due Date: 22/04/2013
Please read the following instructions carefully before solving & submitting assignment:
It should be clear that your assignment will not get any credit (zero marks) if:
The assignment is submitted after due date.
The submitted code does NOT compile.
The submitted assignment is other than .CPP file.
The submitted assignment does NOT open or file is corrupted.
The assignment is copied (from other student or ditto copy from handouts or internet).
For clarity and simplicity, You are required to Upload/Submit only ONE .CPP file.
Don’t wait for grace day. Grace day is only given if there is problem on due date. Submit your solution within due date.
Note that no assignment will be accepted through email if there is any problem on grace day
Note: Use ONLY Dev‐C++ IDE.
The objective of this assignment is
To make you familiar with linked list data structure and programming techniques to implement linked list.
For any query about the assignment, contact at firstname.lastname@example.org
We know that in linked list we have one value and one pointer (to hold the memory address of next node). Note that it is not compulsory to have only one value. There can be more than one value in one node but pointer will remain one.
Write a C++ program to implement linked list data structure. In this problem every node should have six values, the name of node and a pointer. Your program should prompt the user to enter total number of nodes in the list. After this give the name to node and save 6 different values in node. Process should be repeated for each node.
After entering values of all the nodes, sum the values in each node and sort the list in ascending order (on the basis of sum calculated in each node) i.e. node with smallest sum comes first and node with largest sum comes
Note: Values within a single node should not duplicate. If a user tries to enter any duplicate value WITHIN A NODE then show a warning message and ask user to enter value again.
The diagram given below is showing the sorted list.