CSE310 HW03, Thursday, 02/18/2010, Due: Thursday, 02/25/2010
Please note that you have to typeset your assignment using either L
A
T
E
X or Microsoft
Word. Handwritten assignment will not be graded. You need to submit a hardcopy
before the lecture on the due date. You also need to submit an electronic version at
the digital drop box. For the electronic version, you should name your ﬁle using the
format HW03LastNameFirstName.
1. (10 pts) Assume that you are using quicksort to sort 6 elements
a
1
,a
2
,...,a
6
. Also assume
that the elements are distinct. Draw the part of the decision tree that contains the path from
the root node to the leaf node corresponding to the ordering
a
1
< a
3
< a
5
< a
2
< a
4
< a
6
.
Solution:
The decision tree is as follows.
1
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentGrading Keys:
Starting from root node, 1pt for each correct node, until the 1st mistake;
5pts will be cut oﬀ if there are 4 blocks.
2. (10 pts) Prove that the average time complexity of insertion sort for sorting
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '08
 Davulcu,H
 Algorithms, Data Structures, 2pts, 4pts, 1pt, 3pts, average time complexity

Click to edit the document details