CSE 2011Z 2010W Final Exam Practice Solutions

CSE 2011Z 2010W Final Exam Practice Solutions - 30 24 40 11...

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 30 24 40 11 26 58 13 48 18 16 14 12 10 8 6 4 2 0 0 18 14 10 6 2 4 8 12 16 2n 2n O( n log n) O ( n) O( n log n) O( n log n) O ( n) O( n2 ) QuickSort(A) stack S push A onto S while S A = pop(S ) if A.length > 1 ( L, R) = Partition(A) push R onto S push L onto S [0, n2 1] O ( n) log n2 = 2 log n 2 log n log n O 2 n+2 (( log n )) O ( 2 ( n + 2 n )) 2 log n On () LA126 LA22 LA141 LA15 LA16 LA127 LA32 LA31 LA169 v 2 s 1 2 t O( n log n) p w( p ) (u, v ) p p w p > w( p ) p (u, v ) p p () p p (u, v ) p (u, v ) ...
View Full Document

Ask a homework question - tutors are online