Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

O. (@) A collection of nodes is arranged as a binary search tree ordered on the he which contains distinct positive integers for each of

image text in transcribed
O. (@) A collection of nodes is arranged as a binary search tree ordered on the he which contains distinct positive integers for each of the mode. In addition to INFO, LLINK and RLINK. each node has three other fields CLASS, SUCC and PRED CLASS is an information field containing a single letter that denotes the class to which the node belongs (there being up to 26 classes). The nodes in each class are arranged as a doubly linked circular list with a list head, by using the pointer fields SUCC and PRED to point to the successor and predecessor of a node in the list, respectively. The format of the nodes is The following diagram shows an example in which there are 5 nodes in the binary search tree. Given a pointer ROOT to the root node of the binary search tree and an integer k occurring in the INFO field of some node in the tree, write a function that will search the tree for the node N containing the value k, and will then find and turn a pointer to the head node of the class list containing N. So, for example, if ROOT points to the root of the tree above and k 15, the function should return a pointer to HEAD-A. You should assume that a head node is recognisable by the value 9999 in the INFO field. (5 marks) (b) Comment briefly on any disadvantages and/or advantages of using each of the following representations for the class lists instead of the above representation: (i) singly-linked circular lists; (1) singly-linked non-circular lists; (iii) doubly-linked non-circular lists. O. (@) A collection of nodes is arranged as a binary search tree ordered on the he which contains distinct positive integers for each of the mode. In addition to INFO, LLINK and RLINK. each node has three other fields CLASS, SUCC and PRED CLASS is an information field containing a single letter that denotes the class to which the node belongs (there being up to 26 classes). The nodes in each class are arranged as a doubly linked circular list with a list head, by using the pointer fields SUCC and PRED to point to the successor and predecessor of a node in the list, respectively. The format of the nodes is The following diagram shows an example in which there are 5 nodes in the binary search tree. Given a pointer ROOT to the root node of the binary search tree and an integer k occurring in the INFO field of some node in the tree, write a function that will search the tree for the node N containing the value k, and will then find and turn a pointer to the head node of the class list containing N. So, for example, if ROOT points to the root of the tree above and k 15, the function should return a pointer to HEAD-A. You should assume that a head node is recognisable by the value 9999 in the INFO field. (5 marks) (b) Comment briefly on any disadvantages and/or advantages of using each of the following representations for the class lists instead of the above representation: (i) singly-linked circular lists; (1) singly-linked non-circular lists; (iii) doubly-linked non-circular lists

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

Recommended Textbook for

Sql All In One For Dummies 7 Books In One

Authors: Allen G Taylor ,Richard Blum

4th Edition

1394242298, 978-1394242290

More Books

Students also viewed these Databases questions

Question

6. Identify seven types of hidden histories.

Answered: 1 week ago

Question

What is the relationship between humans and nature?

Answered: 1 week ago