quiz1soln - Quiz 1 Solution CpE 360 – Computational...

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

View Full Document Right Arrow Icon
1 Quiz 1 Solution CpE 360 – Computational Algorithms and Data Structures Instructor: Ashish Patel October 12, 2006 (Close notes, close books. Circle on your answers) 1) Which of the following sorting algorithm(s) cannot be stable: selection sort, merge sort, quick sort, bucket sort? a. Selection sort b. Merge sort c. Quick sort d. bucket sort 2) Sort the following sequence using Radix sort: COW, DOG, SEA, BOX, BIG, TAB Identify the first step for the radix sort? a) BIG, BOX, COW, DOG, TAB, SEA b) BIG, BOX, COW, DOG, SEA, TAB c) SEA, TAB, DOG, BIG, COW, BOX d) SEA, TAB, BIG, DOG, COW, BOX 3) A simple sorting algorithm like selection sort or bubble sort has a worst-case of a) O(1) time because all lists take the same amount of time to sort b) O(n) time because it has to perform n swaps to order the list c) O(n 2 ) time because sorting 1 element takes O(n) time d) O(n 3 ) time, because the worst case has really random input which takes longer to sort 4) What are the first two elements swapped in an array (31, 15, 20, 10, 68) using a selection
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.

Page1 / 2

quiz1soln - Quiz 1 Solution CpE 360 – Computational...

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