C++ Answers

Questions answered by Experts: 9 913

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

Write a program for Linked-list implementation of a complete binary tree. The program must


have the following functionalities.


a) Insert(): inserts a new ITEM to the complete binary tree. The items are of integer type.


b) Height(): returns height of a node recursively. Height (N) = MAX(Height(L), Height(R))


+ 1. Here, L and R respectively represent the Left child and Right child of node N. Height


of a leaf node is 0.


c) Preorder(): returns the preorder traversal sequence of the binary tree. Use recursive


implementation.


d) Postorder(): returns the postorder traversal sequence of the binary tree. Use recursive


implementation.

Modify the program by creating an array of n objects using

pointers. Show the details of n items by using pointers to object concept.


(Pointers to objects)

Define a class 'Item' that is used to store and display the information regarding the item

number and its price. Write a program to store and display the details of one

items by using both normal object and pointer to object separately. Display

appropriate message wherever necessary.


Write a program for:

Searching a word present in a sentence or not, if present print its location with a successful note.


Write a program to implement the Merge sort algorithm with the space optimization for


auxiliary space O(n/2).

Using while or do while. An ordinary colored printer can print 12 pages per minute. Make a program that will input number of pages, and compute the time to complete the print out. Consider the minutes and hour of your display. Your program will terminate if you input zero in the number of pages.

(minutes =no.pages /12) Ex: Input pages : 720

Minutes = 60 Hour= 1


(Pointers to derived classes) Write a program to illustrate how pointers to a base class is used for both base and derived class.


Modify the program by creating an array of n objects using pointers. Show the details of n items by using pointers to object concept.


(Pointers to objects) Define a class Item that is used to store and display the information regarding the item number and its price. Write a program to store and display the details of one items by using both normal object and pointer to object separately. Display

appropriate message wherever necessary.


Searching a word present in a sentence or not, if present print its location with a successful note.


LATEST TUTORIALS
APPROVED BY CLIENTS