SYSC2002_2004_Winter

SYSC2002_2004_Winter - Question 1 (18 marks) A double-ended...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Page 2 of 7 Question 1 (18 marks) A double-ended queue (or “deque”) is a queue that permits enqueues and dequeues to be performed at either end. The basic operations are “enequeue at front”, “enqueue at end”, “dequeue from front”, and “dequeue from end”. Dequeues can be very conveniently implemented using a doubly linked list. a) Your answer booklet contains most of the class declaration for a deque of double values. You are to fill in the missing private portion. Be sure to indicate (with appropriate comments) which end of the doubly linked list is the “front” of the deque. b) Give the implementation of the destructor. c) Give the implementation of “dequeueAtEnd”. d) Give the implementation of method “size”. e) Give the implementation of the copy constructor. Question 2 (6 marks) In the space provided in your answer booklet, write a recursive function that finds and returns the largest value in some portion of an unsorted array. The area of interest starts at element “start” and runs through element through “end” (as illustrated below). start
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/24/2010 for the course SYSC 2002 taught by Professor Unknown during the Fall '07 term at Carleton.

Page1 / 4

SYSC2002_2004_Winter - Question 1 (18 marks) A double-ended...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online