CSC375 Homework9 George Corser 2009-04-01

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

Info iconThis 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 logical node (except the root) has a data value (v), a size
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 Winter '09 term at University of Michigan-Dearborn.

Page1 / 4

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

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