Due Date:
Wednesday, May 07, 2014
Wednesday, May 07, 2014
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)
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.
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.
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.
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.