Question: In Chapter 6, we discussed how to store a linked list in an array of nodes using index values as pointers and managing our list

In Chapter 6, we discussed how to store a linked list in an array of nodes using index values as pointers and managing our list of free nodes. We can use these same techniques to store the nodes of a binary search tree in an array rather than using dynamic storage allocation. Free space is linked through the left member. 1. Show how the array would look after these elements had been inserted in this order:

Q L W F M R N S Be sure to fill in all the spaces. If you do not know the contents of a space, use the question mark “?”.

nodes [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] free 2. Show the contents of the array after “B” has been inserted and “R” has been deleted.

root .info . left .right

nodes [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] free root .info . left .right

Step by Step Solution

3.35 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The two images you have uploaded are identical and seem to depict a template for representing a binary search tree using an array in a static memory a... View full answer

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 Programming Language Pragmatics Questions!