04-30-2014, 09:37 PM
Total Marks: 20
Due Date:
Wednesday, May 07, 2014
Instructions
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 file is other than .CPP format.
The submitted assignment file does not open or corrupted.
The assignment is copied (from other student or copied from handouts or internet).
Uploading instructions
Don’t wait for grace day. Grace Day is given only if there is problem with LMS 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.
Objective
The objective of this assignment is
To make you familiar with list data structures and programming techniques to implement list data structure by using linked list.
Question:
I am sending you a C++ program related to linked list along with your assignment file. In the given C++ program, I did not write some functions. Name of these functions are given below.
1) main()
2) List add Nodes(int number)
3) void split(int c, List list, List large List, List small List)
4) void difference List(List list A, List list B)
Your assignment is to write the codes of these functions so that given program could be compiled and run to perform the required functionality/purpose.
Moreover required functionality/purpose of this C++ program is to perform the following tasks given below by using a linked list.
Splitting up an odd list:
1) Your program should ask the user to input any number.
2) Create a linked list that will contain all the odd elements less than the number which you entered in first step. Also display this list.
3) Now ask the user to enter any pivot element. Pivot element is a simple integer number. Use this pivot element to divide the list into two halves. First half will contain all the elements smaller than that pivot element. Save this first half into a list called small List. Second half will contain all the elements larger than that pivot element. Save this second half into a list called large List.
4) Display small List and Large List that you formed in step 3.
Performing set difference operation on two odd lists:
1) Your program should ask the user to input any two integer number for example 30 and 20.
2) Create a linked list i.e. ‘list A’ that will contain all the odd elements less than the number 30 which you entered in first step. Also display this list.
3) Create a linked list i.e. ‘list B’ that will contain all the odd elements less than the number 20 which you entered in first step. Also display this list.
4) Perform the set difference operation on the two lists ‘list A’ and ‘list B’.
5) Save the result of set difference operation in another list called set Difference and then display the list set Difference.
Note:
1) Pivot element should be positive, greater than 0 and pivot element must also be from the list.

mileys81: