Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose that the following table shows a (simplified) memory map of a binary search tree. The first row shows the memory addresses and the second

image text in transcribed

Suppose that the following table shows a (simplified) memory map of a binary search tree. The first row shows the memory addresses and the second row shows the data stored at those addresses. Each pointer and each key value occupies one address. The variable tree which points to the root node is stored at the address 01. Each node of the binary search tree occupies three consecutive addresses: the first is the key value, the second is the address of the left subtree and the third is the address of the right subtree. Let address 00 represent empty subtrees (NULL value) 00 0102 03 0405 0607 08 09 0A OB 0C OD OE OF 2502 14 32 00 00 4 00 0 OA 10 06 10 10 11213 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 16 0000 40 OD 1A 54 0000 (i) Draw a graphic representation of the tree (ii) Insert a binary-search-tree node with key value 60, assuming that the allocated addresses are 1D, 1E, and 1F . Show corresponding updates on the above memory map and on the tree drawn in part (i)

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started