CpE 360 Midterm Solution

CpE 360 Midterm Solution - Midterm Exam CpE 360 –...

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

View Full Document Right Arrow Icon
1 Midterm Exam CpE 360 – Computational Algorithms and Data Structures Instructor: Ashish Patel Name: _________________ ID Number: _________________ Signature: _________________ All solutions must be (i) either delivered at my Lab Burchard-315 by 4:00 P.M. (ii) or submitted per email at [email protected] by 4:00 P.M. on November 1, 2006, No late submission will be taken into consideration! Please print your name clearly, if you submit your handwritten solution. The work you turn in must be your own personal work, composed and written by you. If I am not around when you come to drop your solution, please leave on my desk. Note: Solutions must be readable (especially handwriting!!), concise, complete and must include pledge of the Honor system.
Background image of page 1

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

View Full Document Right Arrow Icon
2 1) Circle on your Answer. True or False. i) An algorithm A which requires O(n log n) time is always faster than an algorithm B which requires O(n 2 ) time. ---> True False Answer: Beacuse for small n algorithm B might be faster and Algorithm A might be slower. ii) Merge sort and radix sort are two example of divide-and conquer sorting algorithm. ---> True False iii) A stack cannot be implemented as a partially filled array. ---> True False iv) Time analysis is an analysis of how many operations an algorithm requires. ---> True False v) Merge sort and quick sort are much more efficient that selection sort and insertion sort. ---> True False vi) A single C++ program can use both a stack and a queue. ---> True False vii) In the Quick Sort algorithm, always choosing the first element of the current subarray is a safe choice (in the sense that average time complexity is commonly attained). ---> True False 2) Circle on your answer. Multiple choices. i) What underlying data structure is quickest for random access? (a) Array (b) Singly linked list (c) Doubly linked list ii) n 3 + n 2 logn is: (a) O(n 3 logn) (b) (3n) (c) O(n 3 ) (d) O(9 n ) iii) 7n 8 + 5 n is: (a) O(7n 8 ) (b) O(5 n ) (c) O(12 n ) (d) O(n 12 ) iv) 5nlogn + 6n 2 +2500 is: (a) O(5nlogn) (b) O(n
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 11

CpE 360 Midterm Solution - Midterm Exam CpE 360 –...

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

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