1 / 17

A Study of Balanced Search Trees: Brainstorming a New Balanced Search Tree

Anthony Kim, 2005 Computer Systems Research. A Study of Balanced Search Trees: Brainstorming a New Balanced Search Tree.

Download Presentation

A Study of Balanced Search Trees: Brainstorming a New Balanced Search Tree

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. Anthony Kim, 2005 Computer Systems Research A Study of Balanced Search Trees:Brainstorming a New Balanced Search Tree

  2. This project investigates three different balanced search trees for their advantages and disadvantages, thus ultimately their efficiency. Run time and memory space management are two main aspects under the study. Statistical analysis is provided to distinguish subtle differences if there is any. A new balanced search tree is suggested and compared with the four balanced search trees under study,. Balanced search trees are implemented in C++ extensively using pointers and structs. Abstract

  3. A simple binary search tree has some disadvantages, specifically from its dependence on the incoming data, that significantly affects its tree structure hence its performance. (Ex. linear tree) An optimal search tree is one that tries to minimize its height given some data. (Ex. Red-black tree has 2lg(n+1) height max) Some of balanced search trees are red-black tree, AVL tree, weight-balanced tree, and B tree. Introduction

  4. Simple vocabs: nodes, edges, children, parent, root Printing tree using recursion: pre-, in-, and post-order traversal Basic binary search tree functions: insertion, lookup, deletion (only first two apply in this project) Rotating functions: the key player in balancing (Left rotation and right rotation.) Background

  5. Four properties The root of the tree is colored black. All paths from the root to the leaves agree on the number of black nodes. No path from the root to a leaf may contatin two consecutive nodes colored red. Every path from a node to a leaf (of the descendants) has the same number of black nodes Has height at most 2lg(n+1) Some Balanced Search (Red-black tree)

  6. Weight balanced tree and height balanced tree are very similar. Weight balanced tree (Height balanced tree) has one property At each node, the difference between weight(height) of left subtree and weight(height) of right subtree is less than the threshold value. Supposedly yield height lg(n) at most Some Balanced Search Tree(Weight & height balanced search tree.)

  7. Assumption on statistical data Give lower bound and upper bound of total data input, random behavior is assumed, meaning data points will be evenly distributed throughout the interval Multiple “crests” is assumed to be present in the interval. Each node will have a key (data number), an interval (with lower and upper bounds of its assigned interval) and weights of left subtree and right subtree. A New Balanced Search TreeMedian-weight-mix tree

  8. Algorithm The weights of each subtree are calculated based on constants R and S R = the importance of focusing frequency heavy data points S = the importance of focusing frequency weak data points Left/right rotations to balanced R to S ratio A New Balanced Search TreeMedian-weight-mix tree

  9. Testing Methodology • 14 Randomly generated test cases (test case size ranges 20 – 10,000) • 4 Real test scores of math competition etc. • Things I am looking for • Total Run Time • Average Time Retrieval • Height of Tree • Average Retrieval Depth

  10. Test Runs (Height-balanced Tree)

  11. Results

  12. Results

  13. Result • Total run time and average retrieval time data did not make any sense. • Hard to time processes on fast computers • Red-black tree segmentation faulted for large test cases >500, so it provided no experimental data

  14. Result (Height)

  15. Result (Average retrieval depth)

  16. Analysis • All balanced search trees show logarithmic characteristics for height and average retrieval depth as expected. (except red-black tree) • Height-balanced tree seems to perform the best among three working balanced search trees. • Median-weight-mix tree’s logarithmic line lies between height-balanced tree’s line and weight-balanced tree’s line.

  17. Conclusion • The project experimentally showed that balanced binary search trees show logarithmic characteristics. • Median-weight-mix tree’s performance is an intermediate between height-balanced tree’s and weight-balanced tree’s. • More studies should be done on other balanced search trees or variants of search trees studied in this project

More Related