1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zzz [600]
3 years ago
9

(1) 1. (15 points/ 3 points each) (a) Draw the binary search tree that is created if the following numbers are inserted in the t

ree in the given order. 12 15 3 35 21 42 14

Engineering
1 answer:
Alex777 [14]3 years ago
6 0

Answer:

The binary search tree BST that is created is shown in the figure in the attached file

The missing part of the question is to draw the balanced binary search tree containing the same numbers given in the question.

You might be interested in
You will create an array manipulation program that allows the user to do pretty much whatever they want to an array. When launch
enyata [817]

Answer:

Check the explanation

Explanation:

#include <iostream>

using namespace std;

void insert(int* arr, int* size, int value, int position){

if(position<0 || position>=*size){

cout<<"position is greater than size of the array"<<endl;

return ;

}

*size = *size + 1 ;

for(int i=*size;i>position;i--){

arr[i] = arr[i-1];

}

arr[position] = value ;

}

void print(int arr[], int size){

for(int i=0;i<size;i++){

cout<< arr[i] <<" ";

}

cout<<" "<<endl;

}

void remove(int* arr, int* size, int position){

* size = * size - 1 ;

for(int i=position;i<*size;i++){

arr[i] = arr[i+1];

}

}

int count(int arr[], int size, int target){

int total = 0 ;

for(int i=0;i<size;i++){

if(arr[i] == target)

total += 1 ;

}

return total ;

}

int main()

{

int size;

cout<<"Enter the initial size of the array:";

cin>>size;

int arr[size],val;

cout<<"Enter the values to fill the array:"<<endl;

for(int i=0;i<size;i++){

cin>>val;

arr[i] = val ;

}

int choice = 5,value,position,target ;

do{

cout<<"Make a selection:"<<endl;

cout<<"1) Insert"<<endl;

cout<<"2) Remove"<<endl;

cout<<"3) Count"<<endl;

cout<<"4) Print"<<endl;

cout<<"5) Exit"<<endl;

cout<<"Choice:";

cin>>choice;

switch(choice){

case 1:

cout << "Enter the value:";

cin>>value;

cout << "Enter the position:";

cin>>position;

insert(arr,&size,value,position);

break;

case 2:

cout << "Enter the position:";

cin>>position;

remove(arr,&size,position);

break;

case 3:

cout<<"Enter the target value:";

cin>>target;

cout <<"The number of times "<<target<<" occured in your array is:" <<count(arr,size,target)<<endl;

break;

case 4:

print(arr,size);

break;

case 5:

cout <<"Thank you..."<<endl;

break;

default:

cout << "Invalid choice..."<<endl;

}

}while(choice!=5);

return 0;

}

Kindly check the attached images below for the code output.

3 0
4 years ago
Alternating current flows in___ direction(s) and direct current flows in___direction(s)
Oduvanchick [21]

Answer:

<u><em>both, one</em></u>

Explanation:

<em>Alternating current flows in both directions and direct current flows in one  direction.</em>

<em></em>

<em>Hope it helps.</em>

<em>;)</em>

<em><3</em>

8 0
3 years ago
To produce cooling the refrigerant much
lawyer [7]
Yes that is correct good job ❤️
7 0
4 years ago
A ____________ is a term that originally was referring to a way to reproduce a technical drawing documenting an architectural or
larisa86 [58]

Answer:

The answer is  blueprint.

Explanation:

Have a nice day or night!

7 0
2 years ago
) An ammonia nitrogen analysis performed on a wastewater sample yielded 30 mg/L as nitrogen. If the pH of the sample was 8.5, de
Delicious77 [7]

Answer:

NH_4^+ = 2.5 mg/lt

Explanation:

Given data:

Ammonia Nitrogen 30 mg/L

pH = 8.5

-log[H +] = 8.5

[H +] = 10^{-8.5}

NH_4 ^{+} ⇄ H^{+} + NH_3

Rate constant is given as

K_a = \frac{[H^{+}] [NH_3]}{NH_4^{+}} ...........1

K_a = 5.6 \times 10^{-10}

Total ammonia as NItrogen is given as 30 mg/l

\%NH_4^{+} = \frac{ [NH_4] \times 100}{[NH_4^{+}] + [NH_3]}

                    = \frac{100}{\frac{NH_4^+}{NH_4^+} +\frac{NH_3^+}{NH_4^+}}

                    = \frac{100}{1+ \frac{NH_3^+}{NH_4^+}} .....2

from equation 1 we have

\frac{NH_3^+}{NH_4^+} =\frac{K_a}{[H^+]} = \frac{5.6\times 10^{-10}}{10^{8.5}}

plug this value in equation 2 we get

\%NH_4^{+} = 84.96 \%

Total ammonia as N = 30 mg/lt

NH_4^+ = \frac{84.96}{100} \times 30 = 25.5 mg/lt

7 0
3 years ago
Other questions:
  • Soap is a very interesting chemical. We even discussed it on the discussion board. How does it work, exactly?
    7·1 answer
  • Which of the following explains why material properties present challenges for engineers?
    15·1 answer
  • Diffusion of Ammonia in an Aqueous Solution Ammonia (A)-water (B) solution ta 278 K and 4 mm thick is in contact with an organic
    12·1 answer
  • We would like to measure the density (p) of an ideal gas. We know the ideal gas law provides p= , where P represents pressure, R
    15·1 answer
  • Let A→=(150iˆ+270jˆ) mm , B→=(300iˆ−450jˆ) mm , and C→=(−100iˆ−250jˆ) mm . Find scalars r and s, if possible, such that R→=rA→+s
    13·1 answer
  • A heat pump cycle whose coefficient of performance is 2.5 delivers energy by heat transfer to a dwelling at a rate of 20kW.
    14·1 answer
  • What is polarized electrical receptacle used for
    14·1 answer
  • Consider the velocity boundary layer profile for flow over u flat plate to be of the form u = C_1 + C_2 y. Applying appropriate
    6·1 answer
  • Problem Statement: Air flows at a rate of 0.1 kg/s through a device as shown below. The pressure and temperature of the air at l
    11·1 answer
  • Biblical studies of john​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!