{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

T06_Discuss

# T06_Discuss - void addSecondToFirst(List<int>& L1...

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

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:
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: void addSecondToFirst(List<int> & L1, const List<int> & 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<int> & L); 4. [Challenging question] Write a recursive function that prints a singly linked list L in reverse order. 1...
View Full Document

{[ snackBarMessage ]}