{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CSC375 Homework9 George Corser 2009-04-01

CSC375 Homework9 George Corser 2009-04-01 - CSC 375...

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

View Full Document Right Arrow Icon
CSC 375 Homework 9 (EXTRA CREDIT – 6.13) George Corser Problems from Ch. 6, Shaffer (pp. 211-213): 2009 April 1 6.9, 6.12, 6.14, 6.15, plus extra credit 6.13 6.9 Overhead fractions for the following implementations: List of children : In this case, all of the tree’s nodes are elements of an array. Referring to Figure 6.9 (p. 203), for each node in the tree, there is an array element containing a data value (v), a parent pointer (p) and another pointer (p), which points to the first child (p). Plus, for every node except the root, there is a linked list element containing the pointer from its parent. That’s 3 pointers and one data value. Ignoring array overhead and fudging root overhead , the overhead fraction would be, p v p 3 3 + , or with array indices, i p v i p + + + 3 3 . Figure 1: List of children Left-child/right-sibling : Again, every node has three pointers (left, parent and right) and a data value, so the overhead ratio is the same as above, p v p 3 3 + . Dynamic node implementation (6.3.3, Figure 6.12): In this case, it helps to beak up the data based on each “logical” element, rather than by its physical array. Every
Image of page 1

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

View Full Document Right Arrow Icon
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