Computer Science: An Overview: Global Edition (12th Edition)

Published by Pearson Higher Education
ISBN 10: 1292061162
ISBN 13: 978-1-29206-116-0

Chapter 8 - Data Abstractions - Chapter Review Problems - Page 411: 30

Answer

Root pointer = 42

Work Step by Step

To represent the given tree structure in memory, we need to fill in the blank cells accordingly. Let's map out the tree structure based on the memory contents: ``` Node C (at 30) Left: null → 31 = 0 Right: E is at 39 → 32 = 39 Node H (at 33) Left: null → 34 = 0 Right: null → 35 = 0 Node K (at 36) Left: H is at 33 → 37 = 33 Right: P is at 45 → 38 = 45 Node E (at 39) Left: null → 40 = 0 Right: null → 41 = 0 Node G (at 42) Left: C is at 30 → 43 = 30 Right: K is at 36 → 44 = 36 Node P (at 45) Left: null → 46 = 0 Right: null → 47 = 0 The Final Memory Table looks as follows: Address Contents 30 C 31 0 32 39 33 H 34 0 35 0 36 K 37 33 38 45 39 E 40 0 41 0 42 G 43 30 44 36 45 P 46 0 47 0 The root node is G, which starts at address 42. So the root pointer = 42
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.