Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4 Drawing Trees In this question, we treat the memory as a large array Mem and represent trees in Men as we did in the

image text in transcribed

4 Drawing Trees In this question, we treat the memory as a large array Mem and represent trees in Men as we did in the tutorials of Week 4 Task (f): Draw the tree created by the following code. Assume that the address of its root stored in variable root int new.node (int value) newblock- allocate.memory (3); newbloek +0END new block+1 value; new block+2 END return newblock block1-newnode (3); to block2 ew-node (3) ; n block3 ew node (7) 1z block4new node (0); a blockS node (3) 14 block6-non-rede (3); e root- block3 Mem block3 blockl s Mom block3 +2] -bloek5 s Mem blockblock6; Men bock1 +2] block4; Task (g): Draw the tree represented in the memory as follows (only the relevant parts of the memory are shown). Assume that root 313 i Meni] 436 4372 438 ENID 439 61 40 END 441 442 316 443 100 44740 i Memi 736John" 737 END 738 739 438 740 END 741 200 742 END 743 999 744 "XYZ" i Memi 313 END i Memil 3940 314 315 442 316 END 317 318 399 319 END 320 88 21 END 395 319 396 12 397 END 398 "Goal" 399 395 400 333 401 737 102 123

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions