Prog04 - CSC 375 Program 4 George Corser 2009 April 3...

Info icon This 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 400,000 600,000 800,000 1,000,000 1,200,000 1,400,000 1,600,000 1,800,000 Number of Cells in Maze Number of Traversals UF UFS UF 1,863 40,540 120,236 UFS 2,269 164,449 1,590,099 20 120 240
Image of page 1

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

View Full Document Right Arrow Icon
RAW DATA header rseed cells rows cols FINDs travs
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern