07_Vorlesung_22_Nov_2007

07_Vorlesung_22_Nov_2007 - Datenstrukturen &...

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

View Full Document Right Arrow Icon
22.11.2007 helmut.hauser@IGI Datenstrukturen & Algorithmen VO 708.031 7. Vorlesung, am 22.Nov. 2007
Background image of page 1

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

View Full DocumentRight Arrow Icon
22.11.2007 helmut.hauser@IGI Achtung: Vorlesung nächste Woche ( 29.Nov ) fällt aus !
Background image of page 2
22.11.2007 helmut.hauser@IGI Wiederholung – Partition Zerlegen von Feldern Speichere das lineare Feld A[n] so um, dass folgendes gilt: A[l] A[r] für alle l=1,2,…k und r = k+1,k+2,…n. Definition Zerlegen: lineares Feld A[1. .n] klein groß k lr
Background image of page 3

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

View Full DocumentRight Arrow Icon
22.11.2007 helmut.hauser@IGI Zerlegen (Partition) Das Bezugselement ist das sog. Pivotelement PARTITION (A, l , r) 1: p = A[l] 2: j=l-1 , k=r+1 3: LOOP REPEAT j=j+1 UNTIL A[j] p 4: REPEAT k=k-1 UNTIL A[k] p 5: IF j < k THEN 6: vertausche (A[j], A[k]) 7: ELSE 8: RETURN k Laufzeit: Θ (n) Pivotelement
Background image of page 4
22.11.2007 helmut.hauser@IGI Quicksort QUICKSORT (A , l , r) 1: IF l < r THEN 2: k = PARTITION (A,l,r) 3: QUICKSORT (A,l,k) 4: QUICKSORT (A,k+1,r) [LINK] T(n) = O(n) + T(k) + T(n-k) klein groß k T(1) = O(1)
Background image of page 5

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

View Full DocumentRight Arrow Icon
22.11.2007 helmut.hauser@IGI Quicksort-Laufzeit Beobachtung: • Pivotelement ist wichtig • Tiefe des Rekursionsbaums hängt davon ab (balancend-unbalanced) • Best case: balanced (a)
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/19/2009 for the course HKJLHKJL 565 taught by Professor Fhfh during the Spring '09 term at University of Graz.

Page1 / 11

07_Vorlesung_22_Nov_2007 - Datenstrukturen &amp;...

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

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