Prog04 - CSC 375 Program 4 George Corser 2009 April 3 Program 4 Parent-Pointer General Tree Implementation Program 4 was implemented in two ways

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

View Full Document Right Arrow Icon
CSC 375 Program 4 George Corser 2009 April 3 Program 4: Parent-Pointer General Tree Implementation Program 4 was implemented in two ways. Version 1 (header file: uf.h) used both the weighted union rule and path compression. Version 2 (header file: ufs.h) used neither. Consider the charts below. They show that, in Version 1, the relationship between number of cells and number of traversals was relatively linear. In Version 2, however, the relationship between number of cells and number of traversals was exponential. They also show that the ratio of FINDs-per-traversal were constant for Version 1 and exponentially increasing for Version 2. Conclusion: weighted union rule and path compression save major computer time. Following page: the raw data and calculations of the averages used in the charts above. Average FINDs per Tree Traversal - 5.00 10.00 15.00 20.00 25.00 30.00 Number of Cells in Maze Ratio UF UFS UF 1.00 1.00 1.00 UFS 2.16 7.96 25.08 20 120 240 Number of Tree Traversals - 200,000
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/19/2010 for the course CSC 375 taught by Professor Turner during the Spring '09 term at University of Michigan-Dearborn.

Page1 / 2

Prog04 - CSC 375 Program 4 George Corser 2009 April 3 Program 4 Parent-Pointer General Tree Implementation Program 4 was implemented in two ways

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

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