answer.
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
Usimov [2.4K]
2 years ago
8

Suppose that we have a set of activities to schedule among a large number of lecture halls, where any activity can take place in

any lecture hall. We wish to schedule all the activities using as few lecture halls as possible. Give an efficient greedy algorithm to determine which activity should use which lecture hall.
Computers and Technology
1 answer:
Burka [1]2 years ago
3 0

Answer:

By Using the Greedy- Activity- Selection algorithm

Explanation:

The Greedy- Activity- Selection algorithm in this case involves

First finding a maximum size set S1, of compatible activities from S for the first lecture hall.

Then using it again to find a maximum size set S2 of compatible activities from S - S1 for the second hall.

This is repeated till all the activities are assigned.

It requires θ(n2) time in its worse .

You might be interested in
At age 16, Cheyenne just got her driver's license. She loves to drive and is thinking of becoming a truck driver, because she he
Ivenika [448]
<span> the answer would be: Does she have or can she develop the strengths needed for this type of work?</span><span />
6 0
1 year ago
Read 2 more answers
JAVA
avanturin [10]

Answer:

   public ArrayList onlyBlue(String[] clothes){

       ArrayList<String> blueCloths = new ArrayList<>();

       for(int i =0; i<clothes.length; i++){

           if(clothes[i].equalsIgnoreCase("blue")){

               blueCloths.add(clothes[i]);

           }

       }

       return blueCloths;

   }

Explanation:

  • Create the method to accept an Array object of type String representing colors with a return type of an ArrayList
  • Within the method body, create and initialize an Arraylist
  • Use a for loop to iterate the Array of cloths.
  • Use an if statement within the for loop to check if item equals blue and add to the Arraylist.
  • Finally return the arrayList to the caller
3 0
1 year ago
Redo Programming Exercise 16 of Chapter 4 so that all the named constants are defined in a namespace royaltyRates. PLEASE DONT F
Komok [63]

Answer:

Code is given below and output is attached in the diagram:

Explanation:

//Use this header file while using visual studio.

#include "stdafx.h"

//Include the required header files.

#include<iostream>

//Use the standard naming convention.

using namespace std;

//Define a namespace royaltyRates.

namespace royaltyRates

{

    //Declare and initialize required named constants.

    const double PAY_ON_DELIVERY_OF_NOVAL = 5000;

    const double PAY_ON_PUBLISH_OF_NOVAL = 20000;

    const double PER_ON_NET_PRICE_SECOND_OPTION =

    0.125;

    const double PER_ON_NET_PRICE_FIRST_4000 = 0.1;

    const double PER_ON_NET_PRICE_OVER_4000 = 0.14;

};

//Start the execution of main() method.

int main()

{

    //Declare and initialize the required variables

    //which are going to be used to calculate

    //royalities under each option.

    float net_price;

    int num_copies;

    float royaltyUnderOption1, royaltyUnderOption2,

    royaltyUnderOption3;

    royaltyUnderOption1 = royaltyUnderOption2

    = royaltyUnderOption3 = 0;

    //Prompt the user to enter the net price of each

    //novel.

    cout << "Please enter the net price for each ";

    cout << "copy of the novel : ";

    cin >> net_price;

    //Prompt the user to enter the estimated number

    //of copies of the novels to be sold.

    cout << "Please enter the estimated number ";

    cout << "of copies to be sold : ";

    cin >> num_copies;

    //Display the required details and royalty

    //calculated under option 1.

    cout << "\n*** Option 1: ****" << endl;

    cout << "Net price of each novel: $" << net_price;

    cout << endl;

    cout << "Estimated number of copies to be sold ";

    cout << "is: " << num_copies << endl;

    cout << "$";

    cout << royaltyRates::PAY_ON_DELIVERY_OF_NOVAL;

    cout << " is paid to author for the delivery of ";

    cout << "the final manuscript and $";

    cout << royaltyRates::PAY_ON_PUBLISH_OF_NOVAL;

    cout << " is paid for the publication of ";

    cout << "novel." << endl;

    royaltyUnderOption1 =

    royaltyRates::PAY_ON_DELIVERY_OF_NOVAL +

    royaltyRates::PAY_ON_PUBLISH_OF_NOVAL;

    cout << "Total amount of royalty under option 1 ";

    cout << "is $" << royaltyUnderOption1 << endl;

    //Display the required details and royalty

    //calculated under option 2.

    cout << "\n*** Option 2: ****" << endl;

    cout << "Net price of each novel: $";

    cout << net_price << endl;

    cout << "Estimated number of copies to be sold ";

    cout << "is: " << num_copies << endl;

    royaltyUnderOption2 =

   (royaltyRates::PER_ON_NET_PRICE_SECOND_OPTION *

    net_price)* num_copies;

    cout << "Total amount of royalty under option 2 ";

    cout << "is $" << royaltyUnderOption2 << endl;

    //Display the required details and royalty

    //calculated under option 3.

    cout << "\n*** Option 3: ****" << endl;

    cout << "Net price of each novel: $" << net_price;

    cout << endl;

    cout << "Estimated number of copies to be sold ";

    cout << "is: " << num_copies << endl;

    //If the number of copies is greater than 4000.

    if (num_copies > 4000)

    {

         //Total amount of royalty will be 10% of net

         //price of first 4000 copies and 14 % of net

         //price of copies sold over 4000.

         royaltyUnderOption3 =

         (royaltyRates::PER_ON_NET_PRICE_FIRST_4000 *

         net_price) * 4000 +

         (royaltyRates::PER_ON_NET_PRICE_OVER_4000 *

         net_price) * (num_copies - 4000);

    }

    //Otherwise,

    else

    {

         //Total amount of royalty will be 10% of net

         //price of first 4000 copies.

         royaltyUnderOption3 =

         (royaltyRates::PER_ON_NET_PRICE_FIRST_4000 *

         net_price) * num_copies;

    }

    cout << "Total amount of royalty under option 3 ";

    cout << "is $" << royaltyUnderOption3 << endl;

    //If the royalty under option 1 is greater than

    //royalty under option 2 and 3, then option 1 is

    //best option.

    if (royaltyUnderOption1 > royaltyUnderOption2 &&

    royaltyUnderOption1 > royaltyUnderOption3)

    {

         cout << "\nOption 1 is the best option that ";

         cout << "author can choose." << endl;

    }

    //If the royalty under option 2 is greater than

    //royalty under option 1 and 3, then option 2 is

    //best option.

    else if (royaltyUnderOption2 > royaltyUnderOption1

    && royaltyUnderOption2 > royaltyUnderOption3)

    {

         cout << "\nOption 2 is the best option that ";

         cout << "author can choose." << endl;

    }

    //If the royalty under option 3 is greater than

    //royalty under option 1 and 2, then option 3 is

    //best option.

    else

    {

         cout << "\nOption 3 is the best option that ";

         cout << "author can choose." << endl;

    }

    //Use this command while using visual studio.

    system("pause");

    return 0;

}

5 0
1 year ago
A customer states that when she removes the printed pages from her laser printer output tray, the black ink smears all over her
luda_lava [24]

Answer:

B. Fuser unit

Explanation:

Based on the scenario that is being described it can be said that the most likely problem is the Fuser unit. This is a part that plays an important role in the printing process. This unit melts the toner and compresses it in order to leave the impression on the paper with heat. A faulty fuser unit will not compress correctly and leave wet ink on the paper causing it to smear.

7 0
2 years ago
How can migrating to an enterprise platform solution help a business improve employee productivity?
Lorico [155]

Answer:

By allowing all employees to access and share the same stored dats and by increasing the number of wmployees in business activities

Explanation:

#<em>carry on learning</em>

5 0
1 year ago
Other questions:
  • CAPTCHAs can be used as a form of signature to create a valid contract in e-commerce. True False
    6·2 answers
  • Why is it important to back up data on a computer before you burn-in test the cpu?
    9·1 answer
  • Dani is paraphrasing from a paragraph of an article for a post on her blog. Which of the following strategies is least likely to
    14·2 answers
  • Add the following 2's complement binary numbers. Also express the answer in decimal. a. 01+ 1011b. 11+ 01010101c. 0101+ 110d. 01
    8·1 answer
  • Which would be the most efficient way to store files on your computer?
    13·2 answers
  • Which decimal value (base 10) is equal to the binary number 1012?
    5·1 answer
  • When onboard and facing the bow of a boat where is the port side
    6·1 answer
  • What web 2.0 features allows users to subscribe to a data plan that charges for the amount of time spent on the internet?
    9·1 answer
  • TQ Artificial Intelligence (AI)
    15·1 answer
  • During an internship, a client requests that her database application be moved to a separate network drive. What kind of archite
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!