1 / 20

Θεωρία Βασικών Δομών Δεδομένων

Θεωρία Βασικών Δομών Δεδομένων. Διδάσκοντες : Μακρής Χρήστος, Τσακαλίδης Αθανάσιος e -mail : makri@ceid.upatras.gr , tsak@ceid.upatras.gr Διδασκαλία : Δευτέρα : 1 7:00-19:00 Αίθουσα Συνεδριάσεων (ΑΣ). Περιγραφή του Μαθήματος.

xiang
Download Presentation

Θεωρία Βασικών Δομών Δεδομένων

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Θεωρία Βασικών Δομών Δεδομένων Διδάσκοντες: Μακρής Χρήστος, Τσακαλίδης Αθανάσιος e-mail: makri@ceid.upatras.gr, tsak@ceid.upatras.gr Διδασκαλία: Δευτέρα: 17:00-19:00 Αίθουσα Συνεδριάσεων (ΑΣ)

  2. Περιγραφή του Μαθήματος Το μάθημα απευθύνεται σε όσους φοιτητές θέλουν να αποκτήσουν βασικές γνώσεις για την περιοχή των δομών δεδομένων και για τις αλγοριθμικές τεχνικές που έχουν προταθεί για την αποδοτική σχεδίαση και υλοποίηση τους.  Το μάθημα αποτελεί συνέχεια των προπτυχιακών μαθημάτων Δομές Δεδομένων, Αλγόριθμοι, Προχωρημένες Δομές και παρέχει στους φοιτητές τα κατάλληλα εφόδια για την σχεδίαση πολύπλοκων δομών δεδομένων που μπορούν να βρουν χρήση σε διάφορες εφαρμογές.

  3. Αντικείμενα που καλύπτονται 1.           Μοντέλα Υπολογισμού και μετρικές χρονικής και χωρικής πολυπλοκότητας 2.        Διαχρονικές Δομές Δεδομένων 3.        Αλγόριθμοι και Δομές  Δεδομένων σε προβλήματα διαχείρισης δενδρικών γραφημάτων. 4.          Ουρές Προτεραιότητας και Αυτοργανώμενα Δέντρα 5.         Αλγόριθμοι Διάταξης και Δομές Ψαξίματος στο RAM Μοντέλα Υπολογισμού.

  4. Διαδικαστικά • Εξέταση (προφορική) • Εργασία: • Παρουσίαση • Γραπτή Αναφορά • Τελικός Βαθμός: • Ημιάθροισμα αν βαθμός εξέτασης >= 5

  5. Λίστα Εργασιών(κάθε εργασία θα βασίζεται σε ένα από τα κάτωθι papers ΚΑΙ σε σχετική με το θέμα βιβλιογραφία) Data Structures for Tree Manipulation D. Harel and R.E. Tarjan. Fast Algorithms for finding nearest common ancestors. SIAM J. Computing , 13(2):338-355, 1984. A.K. Tsakalidis. The Nearest Common Ancestor in a Dynamic Tree, Acta Informatica 25, 37-54 (1988). S. Alstrup and M. Thorup, Optimal Pointer Algorithms for Finding Nearest Common Ancestors in Dynamic Trees, Journal of Algorithms, 35(2): 169-188 (2000) A.L. Buchsbaum, H. Kaplan, A. Rogers and J.R. Westbrook, Linear-time pointer machine algorithms for lca's, mst verification, and dominators, In Annual ACM Symposium on the Theory of Computing (STOC), 30, 1998. R. Cole and R. Hariharan, Dynamic lca queries on trees, In Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), 10, 1999. Rajamani Sundar, Robert Endre Tarjan: Unique Binary Search Tree Representations and Equality-testing of Sets and Sequences STOC 1990: 18-25 Kurt Mehlhorn, R. Sundar, Christian Uhrig: Maintaining Dynamic Sequences under Equality Tests in Polylogarithmic Time. Algorithmica 17(2): 183-198 (1997). Richard Cole, Ramesh Hariharan: Tree Pattern Matching to Subset Matching in Linear Time. SIAM J. Comput. 32(4): 1056-1066 (2003)

  6. Persistence J. R. Driscoll, N. Sarnak, D. Sleator, and R. Tarjan. Making data structures persistent. J. of Computer and System Science, 38:86-124, 1989. J. Driscoll, D. Sleator, and R. Tarjan. Fully persistent lists with catenation. Journal of the ACM , 41(5):943-959, 1994. L. Buchsbaum and R. E. Tarjan. Confluently persistent deques via data structural bootstrapping. J. of Algorithms , 18:513-547, 1995. R. Sundar A. L. Buchsbaum and R. E. Tarjan. Data structural bootstrapping, linear path compression, and catenable heap ordered double ended queues. SIAM J. Computing , 24(6):1190-1206, 1995. H. Kaplan and R. E. Tarjan. Persistent lists with catenation via recursive slow-down. In Proceedings of the 27th Annual ACM Symposium on Theory of Computing , pages 93-102. ACM Press, 1995. H. Kaplan and R. E. Tarjan. Purely functional representations of catenable sorted lists. In Proceedings of the 28th Annual ACM Symposium on Theory of Computing , pages 202-211. ACM Press , 1996. A. Fiat, H. Kaplan, Making Data Structures Confluently Persistent, ACM SODA 2001.

  7. Search Trees and Priority Queues A.K. Tsakalidis, AVL-trees for localized search. Information and Control , 67:173-194, 1985. R. Fleischer, A simple balanced search tree with O(1) worst-case update time. International Journal of Foundations of Computer Science, 7:137-149, 1996 G. S. Brodal. Finger Search Trees with Constant Insertion Time. In Proc. 9th Annual ACM-SIAM Symposium on Discrete Algorithms, pages 540-549, 1998.  M. A. Bender and M. Farach-Colton. The Level Ancestor Problem Simplified. LATIN, pages 508-515, 2002. M. A. Bender, R. Cole, E. Demaine, M. Farach-Colton, and J. Zito. Two Simplified Algorithms for Maintaining Order in a List. Proceedings of the 10th European Symposium on Algorithms (ESA), pages 152-164, 2002. Daniel Dominic Sleator and Robert Endre Tarjan. Self-adjusting binary search trees. Journal of the ACM , 32(3):652-686, July 1985. John Iacono, Alternatives to Splay Trees with O(logn) Worst-Case Access Times, ACM/SIAM SODA 2001, 516-522. Mihai Bădoiu and Erik D. Demaine, A Simplified and Dynamic Unified Structure,  in Proceedings of the 6th Latin American Symposium on Theoretical Informatics (LATIN 2004), Lecture Notes in Computer Science, volume 2976, Buenos Aires, Argentina, April 5-8, 2004, pages 466-473. D.E. Demaine, D. Harmon, J. Iacono, M. Pătraşcu, (2004), Dynamic Optimality— Almost, IEEE Symp. on the Foundations of Computer Science, 45th, Rome, Italy, Oct. 17–19, pp. 484–490.

  8. RAM Algorithms M.L. Fredman and D.E. Willard. Surpassing the information theoretic bound with fusion trees. Journal of Computer and System Sciences ,  47:424-436, 1993. M.L. Fredman and D.E. Willard. Trans-dichotomous Algorithms for Minimum Spanning Trees and Shortest Paths, Journal of Computer and System Sciences , 48:533-551, 1994. H. Gabow, R. Tarjan A Linear-Time Algorithm for a Special Case of Disjoint Set Union Journal of Computer and System Sciences 30(209-220) 1985 . Arne Andersson, Mikkel Thorup, Dynamic Ordered Sets with Exponential Search Tree, ACM STOC 2000, pp.335-342. A. Andersson. Faster deterministic sorting and searching in linear space, Proc. 37th FOCS, pages 135–141, 1996. Yijie Han: Improved fast integer sorting in linear space. SODA 2001: 793-796 Yijie Han: Deterministic sorting in O(nloglogn) time and linear space. J. Algorithms 50(1): 96-105 (2004) Ran Mendelson, Mikkel Thorup, Uri Zwick: Meldable RAM priority queues and minimum directed spanning trees. SODA 2004: 40-48 Ran Mendelson, Robert Endre Tarjan, Mikkel Thorup, Uri Zwick: Melding Priority Queues. SWAT 2004: 223-235

  9. Εισαγωγικά Δομή Δεδομένων= η συγκεκριμένη υλοποίηση ενός συχνά εμφανιζόμενου Αφηρημένου Τύπου Δεδομένων. Αφηρημένος Τύπος Δεδομένων είναι ένα σύνολο μαζί με μία συλλογή πράξεων στα στοιχεία του συνόλου. Παραδείγματα Δομών -- Λεξικό (βασικές πράξεις η εισαγωγή/διαγραφή στοιχείων και ο έλεγχος ανήκει/δεν ανήκει) -- Ουρές Προτεραιότητας(βασικές πράξεις η ένθεση στοιχείων, η εύρεση και διαγραφή του ελαχίστου)

  10. Μοντέλα Μηχανής Μοντέλο Μηχανής Δεικτών (Pointer Machine)= η μνήμη αποτελείται από συλλογή εγγραφών, με κάθε εγγραφή να αποτελείται από μία συλλογή από κελιά. Κάθε κελί έχει ένα τύπο (pointer, integer, real) και η προσπέλαση κελιών γίνεται με χρήση δεικτών. RAM Μοντέλο Υπολογισμού= η μνήμη αποτελείται από ένα πίνακα από κελιά, όπου κάθε κελί προσπελαύνεται με τη διεύθυνσή του. Υποθέτουμε ότι κάθε κελί μπορεί να περιέχει αριθμούς αυθαίρετου μεγέθους και ότι οι βασικές αριθμητικές πράξεις και πράξεις δεικτών παίρνουν σταθερό χρόνο (uniform cost assumption). Μετρικές Εκτίμησης Απόδοσης Χωρική, χρονική πολυπλοκότητα.

  11. Χρονική Πολυπλοκότητα Ανάλυση μέσης περίπτωσης (average case analysis)= μία πιθανοτική κατανομή τίθεται στις πράξεις ενός αφηρημένου τύπου δεδομένων και το μέσο κόστος των πράξεων υπολογίζεται. Ανάλυση Χειρότερης Περίπτωσης (worst case analysis)= υπολογίζονται πολυπλοκότητες χειρότερης περίπτωσης για κάθε πράξη. Ανάλυση Επιμερισμένης Πολυπλοκότητας= υπολογίζεται το συνολικό κόστος μίας ακολουθίας πράξεων και επιμερίζεται το κόστος σε καθεμία πράξη.

  12. Τεχνικές Εκτίμησης Πολυπλοκότητας • Μέθοδος Άθροισης - Άμεσος υπολογισμός του κόστους μίας ακολουθίας πράξεων μέσω ενός συνδυαστικού τύπου • Μέθοδος Τραπεζίτη – Θεωρούμε ότι υπάρχει ένας τραπεζικός λογαριασμός συνδεδεμένος με κάθε δομή δεδομένων που αναλύουμε. Σε κάθε πράξη συσχετίζουμε μία ενέργεια ανάληψης και κατάθεσης χρημάτων. • Μέθοδος Φυσικού – Αναθέτουμε σε κάθε στγμιότυπο της δομής μία συνάρτηση που λαμβάνει θετικές πραγματικές τιμές και ονομάζεται συνάρτηση δυναμικού.

  13. Το πρόβλημα του Λεξικού • Ορισμός Είδη Δομών • Comparison BasedΔομές Δεδομένων • Representation BasedΔομές Δεδομένων

  14. ΕίδηΔομών Δεδομένων • Implicit Δομές Δεδομένων (πίνακας στοιχείων) Χρήση Περιστρεφόμενων Λιστών, έμμεση κωδικοποίηση δεικτών -> Ο((logn)2) χρόνο ανά ψάξιμο και πράξη ενημέρωσης (Munro) O(logn) χρόνο ανά ψάξιμο και πράξη ενημέρωσης (Francescinni) Είδη Δομών • Comparison BasedΔομές Δεδομένων - Static - Dynamic (weight balanced, height balanced) • Representation BasedΔομές Δεδομένων - Interpolation Search - Tries - Hashing

  15. Το Weighted Dictionary Πρόβλημα Πράξεις: • Access(x,S), O(log(W/w)) • Insert(x,S) O(log(W+w/min(w,w-,w+)) • Delete(x,S) O(log(W/min(w,w-)) • Join(S1,S2) O(log((w1+w2)/w)) • Split(x,S) O(log(W/w)) • ChangeWeight(x,S,δ)Ο(log(W+δ)/w)) Amortized complexity αν χρησιμοποιηθούν splay trees. Worst Case Complexity αν χρησιμοποιηθούν biased trees.

  16. Union-Split-Find Πρόβλημα Διαχειριζόμαστε μία διαμέριση του σύμπαντος U={1,..,n}με την υποστήριξη των ακόλουθων πράξεων: • Find(x): επέστρεψε το όνομα του συνόλου που περιέχει το x • Union(A,B): συγχώνευσε τα δύο σύνολα Α,Β σε ένα νέο σύνολο\ • Split(A,x): διέσπασε το Α σε δύο υποσύνολα Union-Find πρόβλημα, Split-Find πρόβλημα Ο(α(m,n))=min{z1: A(z,4m/n)>logn} όπου A(i,0)=1, για κάθε i Α(0,x)=2x, για κάθε x Α(i+1,x+1)=A(i,A(i+1,x)) για κάθε i,x. Interval Union Split Find Πρόβλημα Upper and Lower Bounded by θ(loglogn) vEB Data Structure

  17. Ουρές Προτεραιότητας Βασικές πράξεις: • Makequeue • Insert(i,h) • Findmin(h) • Deleremin(h) • Meld(h1,h2) • Decreasekey(d,i,h) • Delete(i,h) Heap-ordered(2-3) δέντρα, leftist δέντρα, binomial queues, self adjusting heaps, pairing heaps, Fibonacci Heaps, Relaxed Heaps.

  18. Nearest Common Ancestor • static off-line version • static on-line version • linking roots version • linking and cutting version • dynamic trees version

  19. Τεχνικές Δυναμοποίησης Θεωρείστε μία δομή με χρόνο προεπεξεργασίας Ps(n), χρόνο ερώτησης Qs(n), και χώρου Ss(n) έτσι ώστε οι συναρτήσεις Qs(n), Ps(n)/n, Ss(n)/nνα είναι αύξουσες. Είναι εφικτή η δυναμοποίηση και παραγωγή μίας δομής με χρονικές lognQs(n) χρονική πολυπλοκότητα , lognPs(n)/nχρόνο ενθέσεως και χώρο Ss(n).

More Related