Docsity

Final Exam Review Sheet - Data Structures | CMSC 420, Study notes of Data Structures and Algorithms

Partial preview of the text

Download Final Exam Review Sheet - Data Structures | CMSC 420 and more Study notes Data Structures and Algorithms in PDF only on Docsity!

Lecture Notes CMSC 420 Lecture 27: Final Review Final Overview: This somester we have covered a number of different data structures. The fm damental concept behind all data structures is that of arranging data in a way that permits a given sot of queries or accesses to be performed officiently. The aim has been at describing the general principles thal, lead to good data. structures as opposed lo giving a ‘cookbook of stan- dard techniques. In addition we have cliscussed the mathematies needed lo prove properties andl analyze the performance of these data. structures (both theoretically and empirically). Some of the important concepts that I sec that you should take away from this course are the following: Mathematical Models/Objects: Before you design any data structure or algorithm, first isolate the key mathematical elements of the task at hand. Identily what Lhe mathematical objects are, and what operations you are performing on them. (E.g. Dictionary: insertion, deletion, and finding of numeric keys. Ray Tracing: insertion, and ray tracing queries for a set of spheres in 3-spacc.) Recursive Subdivision: A large number of data. structures (particularly bree based struc- tures) have been defined recursively, by splitting the underlying domain using a key value. The algorithms that deal with them are often most cleanly conceptualized in recursive form (Strong) Induction: In order to prove properties of recursively defined objects, like trees, the most natural mathematical technique is induction. In particular, strong induction is important when dealing with trees. Balance: ‘The fundamental property on which virlually all good date. structures rely isa notion of information balancing, Balance is achieved in many ways (rebalancing by ro- tations, using hash functions to distribute information randomly, balanced merging in Union-Find trees) Amortization: When the running Lime of each operation is less important than the running time of a string of operations, you can often arrive at simpler data structures and al gorithms, Amortization is a technique to justify the officiency of these algorithms, c.g. through the use of potential function which measures the imbalance present in a structure and how your access functions affect this balance Randomization: Another technique for improving the performance of data structures is: if you can't randomize the data, randomize the data structure. Randomized data structures are simpler and more efficient than deterministic data structures which have to worry about worst case scenarios. Asymptotic analysis: Before fine-tuning your algorithm or data structure's performance, first be sure that your basic design is a good one. A half-hour spent solving a recurrence to analyze a data structure may tell you more than 2 days spent prototyping and profiling, Empirical analysis: Asymptotics arc not the only answer. The bottom linc: the algorithms have to perform fast on my data for my application. Prototyping and measuring perfor- mance parameters can help uncover hidden inefficiencies in your data structure. Topics: Since the midierm, these are Lhe main Lopies thal. have been covered, Priority Queues: We discussed leftist heaps and skew-heaps. Priority qucues supported the operations of insert and deleteMin in O(log n) time. Leftist and skew heaps also supported the operation merge. An interesting feature of leftist heaps is that the entire tree does