1 / 11

A Logarithmic Randomly Accessible Data Structure

A Logarithmic Randomly Accessible Data Structure. Tom Morgan TJHSST Computer Systems Lab 2006-2007. Purpose. To create a data structure with: O(log(N)) insertion O(log(N)) deletion O(log(N)) random access To implement the data structure and empirically test the general case run time

chadwickk
Télécharger la présentation

A Logarithmic Randomly Accessible Data Structure

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. A Logarithmic Randomly Accessible Data Structure Tom Morgan TJHSST Computer Systems Lab 2006-2007

  2. Purpose • To create a data structure with: • O(log(N)) insertion • O(log(N)) deletion • O(log(N)) random access • To implement the data structure and empirically test the general case run time • To prove the data structure's worst case run time

  3. Background • Dynamic Arrays • O(N) insertion • O(N) deletion • O(1) random access • Red-Black Trees • O(log(N)) insertion • O(log(N)) deletion • not randomly accessible

  4. The Algorithm Pre-Red Black Tree • Similar to binary search tree • Places values only at the leaves • Each node keeps track of the number of leaves below it • O(log(N)) on all operations in a random case, but not a sequential one • Balancing is underway

  5. An Example Tree

  6. Balancing Techniques • When performing any operation, if not balanced: • Shift one element from bigger side to smaller side • Shift half of bigger side to smaller side • Find best cutoff point along nearest side to smaller side (if right is bigger, the left part of it) and shift over corresponding sub-tree

  7. Red Black Tree • Each node is either red or black • The path from the root to each leaf contains the same number of black nodes • A red node may not have a red parent • Absurd amount of cases • /cry

  8. Testing • Data structure implemented in Java as a class • Test various operations and their runtime using a separate testing program in Java, which uses the class • Tester allows for both random and ordered insertion and deletion • Red Black Tree compared to TreeSet

  9. Results So Far Pre-Red Black Tree • A tree that allows for insertion, deletion and random access • All operations are logarithmic on the random case • Three separate balancing techniques which vary in terms of effectiveness of balancing and time taken by the balancing • None of the balancing techniques are perfect as of now

  10. Results So Far Red Black Tree • It works! • I'm just starting the work on making it randomly accessible • Much to go on this front

  11. Current/Future Work • Make RBT randomly accessible • Later work perhaps on developing parallel processing capabilities

More Related