Draw avl tree diagram using the following keys
12,13,44,43,99,0,88,13,43,2,22
Draw diagram after each step
Note:
No code required only diagrams after each step are needed.
A housing society is represented by a 3D plane. We have a class house which
stores the location of a house of three persons using x, y and z coordinates of
plane. Another class market which stores the location of a main market. Each class
should initialize the data members using parameterized constructor. Keep the data
members of all the classes private. Also display the location of houses and market.
Calculate the distance of houses of all the persons from the market and display
which person’s house is far away from the market. Also display which person has
nearest distance from the market.
The class manager has the access to both class house and market so it swaps the
location of the market with the house of a person that has the largest distance
with the market. in C++
Simulate the fragment of codes below and trace the output.
int *p1, *p2;
p1 = new int;
p2 = new int;
*p1 = 10;
*p2 = 20;
cout << *p1 << “ ” << *p2 << endl;
p1 = p2;
cout << *p1 << “ ” << *p2 << endl;
*p2 = 30;
cout << *p1 << “ ” << *p2 << endl;
Write a program that will prompt the user to input the following:
1. The number of dice to be rolled.
2. How many times the dice should be rolled?
Since the values above will vary, you must use pointer arrays and dynamically allocate memory.
The program will store the total of faces per roll and the values will be later used to plot a graph. The graph should look like the output shown below
3:
4:
5:
6:
7:
8: *
9:
10:
11:
12: *
13:
14:
15:
16:
17:
18:
The asterisk (*) tallies the number of times that total has occurred. 3 and 18 are the minimum and maximum totals, respectively, for rolling 3 dice.
The declaration and implementation sections of the class have been defined for you. Use it to complete your program.
Wap to create One Base class Father data member fname. And Son class derived from Father dada member sname . And GrandSon derived from Son data member gname. Use appropriate function that GrandSon will display all name by it concatenating