Menu

Uploaded 01062020 8 Link Taken 11 59 Pm 01092020 Plan Ahead Time Submit Anyone Asking Ext Q43800169

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. Anyo2. In an array based representation of a binary tree, what should be the maximum size of the array to accommodate the binary

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) <10 > [ 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. <5> 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. <4> 3. For the arithmetic expression: A*B + C * X /Y – Z Draw a binary tree that represents the above expression <6> Show transcribed image text 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

Expert Answer


Answer to 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….

OR