1. Write a C++ program to create a queue of size n. The value in the middle (MID) position of the queue should be zero, value in the MID+1 position should be 1 and the value in MID-1 position should...

I need the answer as soon as possible1. Write a C++ program to create a queue of size n. The<br>value in the middle (MID) position of the queue should be<br>zero, value in the MID+1 position should be 1 and the<br>value in MID-1 position should be fixed to -1.<br>a. Insert the values and display the contents of the<br>queue by ignoring and considering those fixed<br>values.<br>b. Create a binary tree with root value being the MID<br>position value of the above queue. Then the left<br>child of the root should be the value at MID-2<br>position of the queue. Similarly, the right child of the<br>root should be the value at last position of the<br>queue. Display the created tree.<br>C. Accept more values from the user and make the<br>above created tree to be the complete binary tree.<br>d. Display the leaf node values and find the sum of<br>internal node values.<br>

Extracted text: 1. Write a C++ program to create a queue of size n. The value in the middle (MID) position of the queue should be zero, value in the MID+1 position should be 1 and the value in MID-1 position should be fixed to -1. a. Insert the values and display the contents of the queue by ignoring and considering those fixed values. b. Create a binary tree with root value being the MID position value of the above queue. Then the left child of the root should be the value at MID-2 position of the queue. Similarly, the right child of the root should be the value at last position of the queue. Display the created tree. C. Accept more values from the user and make the above created tree to be the complete binary tree. d. Display the leaf node values and find the sum of internal node values.

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here