Question: 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

 Suppose that the following table shows a (simplified) memory map of

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!