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
Arte-miy333 [17]
3 years ago
5

Consider the following sequence of items 10, 36, 25, 54, 37, 12, 75, 68, 42, 86, 72, 90. Insert these items in the order above,

into an initially empty implicit binary max-heap. Show the heap throughout the process but write down the heap as an answer after every 3 INSERT() operations. (Just hand-simulate the behavior of the implicit binary max-heap, and draw the resulting heap, both throughout the entire process and the ones after every 3 INSERT() operations as answers (note that the former is to show all your work so that partial credits can be given in case you make mistakes, while the latter (answers) are the ones to be graded). Draw them in the form of a tree rather than an array.)

Computers and Technology
1 answer:
AnnZ [28]3 years ago
5 0

Answer:

See attachment below

Explanation:

You might be interested in
Write a program that prompts the user to enter in a postive number. Only accept positive numbers - if the user supplies a negati
marusya05 [52]

Answer:

The c++ program to check prime numbers is shown below.

#include <iostream>

using namespace std;

int main() {

   int num, prime=0;

   do

   {

       cout<<"Enter a positive number."<<endl;

       cin>>num;

       if(num<1)

       {

           cout<<"Invalid number. Enter a positive number"<<endl;

           cin>>num;

       }

   }while(num<1);

   

   if(num==1 || num==2 || num==3)

       cout<<num<<" is a prime number."<<endl;

   else if(num%2 == 0)

       cout<<num<<" is not a prime number."<<endl;

   else

   {

       for(int k=3; k<num/2; k++)

       {

           if(num%k == 0)

               prime++;

       }    

   if(prime>1)

       cout<<num<<" is not a prime number."<<endl;

   else

       cout<<num<<" is a prime number."<<endl;

   }

}

OUTPUT

Enter a positive number.

-7

Invalid number. Enter a positive number

0

Enter a positive number.

79

79 is a prime number.

Explanation:

The user input is validated for positivity. A do while loop along with an if statement is implemented for verification.

do

   {

       cout<<"Enter a positive number."<<endl;

       cin>>num;

       if(num<1)

       {

           cout<<"Invalid number. Enter a positive number"<<endl;

           cin>>num;

       }

   }while(num<1);

The test for prime number is done by using multiple if else statements.

If user inputs 1, 2, or 3, message is displayed.

Else If user inputs an even number, message is displayed for not prime. This is done by taking modulo of the number upon division by 2.

Else if user inputs neither an even number nor a number less than 3, the modulus of the number is taken with divisors beginning from 3 up to half of the input number.

For this, an integer variable prime is initialized to 0. A number can be completely divisible by itself or by its factors.

If the number is divisible by any of the divisors, value of variable prime is increased by 1. If value of prime is greater than 1, this means that the user input is divisible by more than one divisor. Hence, the given number is not a prime number.

5 0
3 years ago
Intellectual property does not include which of the following
liq [111]
I'd have to say C. the steel as this is very physical as the others aren't as much which makes it stand out 
8 0
3 years ago
Please tell fast plzzzzzz. ​
shepuryov [24]

Answer:

true....................

6 0
3 years ago
Read 2 more answers
Is there actually a difference between left and right twix
olga2289 [7]
One has more caramel and one has more cookie
6 0
2 years ago
Which of the following words, if it replaced the word "enthusiasts" in the sentence above, would CHANGE the meaning of the sente
Sonja [21]

Answer:

I would need the sentence to make sure that I am correct but I am pretty sure it is C. aficionados

Explanation:

7 0
3 years ago
Other questions:
  • ?an ip address reservation is made by creating an association between an ip address and what type of client identifier?
    7·1 answer
  • What command displays a computer s network settings?
    5·1 answer
  • Given the following function definition
    13·1 answer
  • In Microsoft Word, when you highlight existing text you want to replace, you're in
    7·1 answer
  • A user is having trouble signing in to the domain from a computer that has been out of service for several months, and nobody el
    7·1 answer
  • How do you change the order of the slides in your presentation in the slide pane 
    15·2 answers
  • Strengths and weaknesses about esport
    10·1 answer
  • Your program has a loop. You want to exit the loop completely if the user guesses the correct word.
    6·2 answers
  • Task 2
    13·1 answer
  • Scientist Galileo Galilei used the
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!