Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Uploaded on 01.06.2020 at 8 am. The link will be taken out at 11:59 pm of 01.09.2020. (You plan ahead of time to submit. Anyone

image text in transcribedimage text in transcribed

Uploaded on 01.06.2020 at 8 am. The link will be taken out at 11:59 pm of 01.09.2020. (You plan ahead of time to submit. Anyone asking to extend the deadline there is a penalty of 20% from the earned grade in this Test). (No exceptions) Total Points 100 Name: 1. Write a C++ code to display the data member of the nodes in reverse order starting from the node pointed to by q and ending at the node pointed to by p of the doubly linked list shown below. (Each node has three members: data that contains the information, right and left members contain addresses to the nodes on either side. Ex. p->left represents the address of the node to the left of node p) [ dotted arrow indicates; there may be any number of nodes between the connecting nodes) head Answer: struct node * temp = p->right; p->right = a; q->right = temp; temp->left = 4; q->left=p; 2. In an array based representation of a binary tree, what should be the maximum size of the array to accommodate the binary tree shown below? 14 28 4 25 33 2 12 30 44 Draw the array with its index values and the items of the above binary tree inside that array. Answer: maximum size should be 15 (since height of the tree is 4, size should be 244 - 1) ii. Perform an Inorder traversal of the above binary tree. 3. For the arithmetic expression: A*B + C * X /Y - Z Draw a binary tree that represents the above expression

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

More Books

Students also viewed these Databases questions

Question

Evaluate the impact of unions on nurses and physicians.

Answered: 1 week ago

Question

Describe the impact of strikes on patient care.

Answered: 1 week ago

Question

Evaluate long-term care insurance.

Answered: 1 week ago