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
Studentka2010 [4]
3 years ago
15

Array A is not a heap. Clearly explain why does above tree not a heap? b) Using build heap procedure discussed in the class, con

struct the heap data structure from the array A above. Represent your heap in the array A as well as using a binary tree. Clearly show all the steps c) Show how heap sort work in the heap you have constructed in part (b) above. Clearly show all the step in the heap sort

Computers and Technology
1 answer:
Aleksandr [31]3 years ago
6 0

Answer:

Sorted Array A { } = { 1, 4, 23, 32, 34, 34, 67, 78, 89, 100 }

Explanation:

Binary tree is drawn given that the binary tree do not follow both minimum heap and maximum heap property, therefore, it is not a heap.

See attached picture.

You might be interested in
Q13. On which option do you click to
fredd [130]

Answer:

The answer is "Home cells Or Home Tab".

Explanation:

The Excel Home Tab is also known as the home cell, it also is used to execute the standard commands like bold, highlight, copy/paste. It also uses templates in a worksheet for cells, which is used to Insert and Delete Cells, and the wrong cell can be defined as follows:

  • In choice Formulas cell or Tab it is used to add the formula, that's why it is wrong.
  • On the choice page cell or Tab is used to view the data, that's why it is wrong.
5 0
3 years ago
Susan is in charge of the inventory reports for her company.She will need to find specific inventory items as well as project in
Nezavi [6.7K]

Answer:

lookup function

Explanation:

We can use the lookup function to find some values or reference in a range, we can use this syntax: LOOKUP( value, lookup_range, [result_range] ), where value is what we are going to look for, lookup_range is the single row or column is the range, and result_range is an optional part, in this range we're going to get the value.

8 0
4 years ago
Create a function named PrintStudents, which takes a string input filename and an integer minimum score value and a string outpu
givi [52]

Answer:

The code is implemented below on C++

Explanation:

#include <iostream>

#include <fstream>

#include <string>

using namespace std;

// function declaration

int PrintStudents(string inputFile, int min_score,string outputFile);

int split(string s,char sep, string words[], int max_words );

int main() {

// test the function

              int n = PrintStudents("students.txt",80,"outStudents.txt");

              if(n != -1)

                             cout<<"\n No. of students : "<<n<<endl;

              else

                             cout<<"\n No such file exists";

              return 0;

}

// function to write the details of the students whose score >= min_score

// inputs : input file, minimum score and output file

// output : number of records read, -1 if error

int PrintStudents(string inputFile, int min_score,string outputFile)

{              // open the input file

              ifstream fin(inputFile.c_str());

              // if input file can be opened

              if(fin.is_open())

              {              // open the output file for writing

                             ofstream fout(outputFile.c_str());

                             int n=0,score;

                             string line;

                             string words[3];

                             // read till the end of file

                             while(!fin.eof())

                             {

                                            getline(fin,line);

                                            n++;

                                            // get the score from the record read

                                            score = split(line,',',words,3);

                                            // check if score>=min_score, then write to output file

                                            if(score >= min_score)

                                                           fout<<words[0]<<", "<<words[2]<<"\n";

                                            if(fin.eof())

                                                           break;

                             }

                             // close the files

                             fin.close();

                             fout.close();

                             return n; // return the number of records read

              }else

              {

                             fin.close();

                             return -1; // file not found

              }

}

// function to split a string on a given separator and return the score

// inputs : string , word separator, array of words and max_words

// output is the score

int split(string s,char sep, string words[], int max_words )

{

              int index=0,i=0 ;

              //loop to extract the words from the line

              while(s.find(sep,index+1)!= -1){

                             words[i] = s.substr(index,s.find(sep,index+1)-index);

                             i++;

                             index = s.find(sep,index+1)+2;

              }

              words[i] = s.substr(index); // extract the last word

              // convert to integer and return the score

              return(stoi(words[1]));

}

4 0
3 years ago
Using the flowchart diagram, identify the decision point of this solution. Identify vendors. Calculate amount due. Determine dat
andreev551 [17]

Answer:

answer is "is there an early pay discount"

Explanation:

3 0
4 years ago
Read 2 more answers
business owners and managers may first balk at the idea of mobile officer workers because there may appear to be a lack of ___ w
Tcecarenko [31]
Business owners and managers may first balk at the idea of mobile officer workers because there may appear to be a lack of ___ when employees are not sitting at a desk in the office

Lack of control, supervision (I.e. micro-management lol).
5 0
3 years ago
Other questions:
  • Why is a cable modem classified as a digital model?
    12·1 answer
  • #Imagine you're writing a program to check if a person is
    8·1 answer
  • Give three reasons why Black hats hack?
    8·2 answers
  • Why is ssh preferred over telnet for remote connections?
    10·1 answer
  • What feature adjusts the top and bottom margins so that the text is centered vertically on the printed page?
    14·1 answer
  • Outline 3 computer system problem that could harm people and propose the way avoid the problem​
    12·1 answer
  • Not every organization integrates with the Internet, but all use some or most of the technology that gave rise to it.
    15·1 answer
  • (25 POINTS) Some applications work on all devices while others work on some devices. True or False?
    13·1 answer
  • Dana is moving to a new house. She has 15 boxes for books. Each box can hold up to 22 books. Dana has 375 books. How many more b
    10·2 answers
  • How to resize an image in photoshop without losing quality.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!