T06_Discuss

T06_Discuss - void...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Tutorial # 6 COMP 152 Spring 2010 Tutorial # 6 (Discussion Exercises) 1 Problems 1. Write a function that prints the middle element of a list L . You have to use the following function declaration: void printMiddleElement(const List<int> & L); 2. Write a function that adds the elements from L 2 to L 1 . Do not add duplicated elements to L 1 ; however, you can insert elements to L 1 in any order. You have to use the following function declaration:
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: void addSecondToFirst(List&lt;int&gt; &amp; L1, const List&lt;int&gt; &amp; L2); 3. Write a function that prints a doubly linked list L in reverse order. You have to use the following function declaration: void printReverseList(const List&lt;int&gt; &amp; L); 4. [Challenging question] Write a recursive function that prints a singly linked list L in reverse order. 1...
View Full Document

Ask a homework question - tutors are online