Objectives: Practicing linked lists, stacks/queues Write a complete solution to
ID: 3635936 • Letter: O
Question
Objectives:Practicing linked lists, stacks/queues
Write a complete solution to a given problem.
Integrity Statement: Read carefully!
Strict directives have been given to the assistants who will be marking this homework as a departmental
policy is being developed on cheating. Any student caught in any form of cheating will be given zero
(0) the first time. (We will not get into the issue of who copied from whom!!!). If such an act reoccurs,
the case will be sent to the Student Discipline Committee.
Problems:
1. Create a function divideMid, which divides a list at its middle. Consider the example:
list<int> l1;
List<int> l2;
Suppose l1 points to the list with elements 1 2 3 4 5 6 7 8. Then the statement
divideMid( l1, l2 );
divides the list into two sublists: l1 will have 1 2 3 4, and l2 will have 5 6 7 8.
Do not use any of the merge, sort or splice methods from the library.
The above operation should be done by you completely.
2. Create a function, which reverses a list. Consider the example:
list<int> l1;
Suppose l1 points to the list with elements 1 2 3 4 5 6 7 8. Then the statement
reverse( l1 );
reverses the elements of the l1 to 8 7 6 5 4 3 2 1.
Do not use the reverse method from the library.
Explanation / Answer
Hi i have solved this question in my notebook, but i can't type it and post it here because time has expired please rate me lifesaver and i'll make sure the answer is in your inbox! or my effort and time would go all in vain i don't do this generally but i am doing because of the circumstances
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.