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
user100 [1]
3 years ago
8

Two boxes overlap if their interiors have at least one point in common. Give an O(n log n)-time algorithm that decides if there

is a pair of boxes in S that overlap and produces one such pair if it exists
Computers and Technology
1 answer:
GaryK [48]3 years ago
5 0

Answer:

// Program is written in C++ programming language

// The program checks if two boxes overlap and prints both boxes

// Comments are used for explanatory purpose

// Program starts here

#include<bits/stdc++.h>

#include <graphics.h>

#include <conio.h>

// Define x and y axis

struct axis { int x, y; };

bool checkRect(Axis l1, Axis r1, Axis l2, Axis r2)

{ // l1, l2, r1 and r2 represent the left and right coordinates of both rectangles

// Check one rectangle is on left side of other

if (l1.x > r2.x || l2.x > r1.x) {

return false; }

// Check if one rectangle is above other

if (l1.y < r2.y || l2.y < r1.y) {

return false; }

return true;

}

// Main Method begins here

int main()

{

// Declare integer variables to enter rectangle coordinates

// For rectangle 1

int left1, left2, right1, right2;

cout<<"Enter First rectangle coordinates: "<<"\n";

cout<<"Top Left: "<<"\n";

cin>>left1;

cout<<"Bottom Left: "<<"\n";

cin>>left2;

cout<<"Top Right: "<<"\n";

cin>>right1;

cout<<"Bottom Right: "<<"\n";

cin>>right2;

// For rectangle 2

int left3, left4, right3, right4;

cout<<"Enter Second rectangle coordinates: "<<"\n";

cout<<"Top Left: "<<"\n";

cin>>left3;

cout<<"Bottom Left: "<<"\n";

cin>>left4;

cout<<"Top Right: "<<"\n";

cin>>right3;

cout<<"Bottom Right: "<<"\n";

cin>>right4;

Axis l1 = {left1, left2}, r1 = {right1, right2};

Axis l2 = {left3, left4}, r2 = {right3, right4};

if (checkRect(l1, r1, l2, r2)) {

cout<<"The Rectangles Overlap"; }

else {

cout<<"Rectangles Don't Overlap";}

// Print Rectangle 1

rectangle (left1, right1, left2, right2);

// Print Rectangle 2

rectangle (left3, right3, left4, right4);

return 0;

}

You might be interested in
music sites through schools wifi 2020 What is one thing a person should do to stay safe when exercising? 100 pts.!
SVEN [57.7K]

Answer:

They should stay away from others (keep workout short or at home)

always do The exercise right-properly

Explanation:

8 0
3 years ago
Read 2 more answers
. True or False? a database breach always involves PII.<br><br> A.true<br><br> B.false
salantis [7]

Answer:

Option B: False

Explanation:

A database breach is sure kind of leak incident in which a sensitive information is disclosed. This data or information must be confidential or protected and is disclosed in a totally unauthorized way.

Data breaches can include:

  • Personal Health Information (PHI)
  • Personally identifiable Information (PII)
  • Secrets
  • Intellectual property

So it means that data breach can be of any type it must not contain PII always.

6 0
3 years ago
Why is it important to consider the readability of a Web page when selecting and applying a background color?
AlekseyPX

If the background is too bright or crazy, you won't be able to read it at all

3 0
3 years ago
Your iphone is not configured to allow calls using this mac
Tema [17]

Answer:

Make sure you have an iCloud account and that your computer is logged into that account.

Explanation:

4 0
3 years ago
A __________ is an entity that manages the use, performance, and delivery of cloud services, and negotiates relationships betwee
densk [106]

Answer:

Cloud Broker is the correct answer of this question.

Explanation:

A cloud broker is a person or industry government entity acting as an operator between the buyer of a cloud computing service and the buyers of that software

  • In a cloud broker would be someone who operates as an interpreter during negotiation involving two or more organizations.
  • A cloud broker is a technology platform which utilizes function transmission between multiple third party service suppliers.
4 0
3 years ago
Other questions:
  • Which statement about word processing software is true? A)You can use it to perform mathematical calculations.B) You can use it
    6·2 answers
  • This is the formula for the future worth of an investment over time with consistent additional monthly payments and a steady rat
    10·1 answer
  • Helpppp plsssss!!!<br><br>thanks.
    7·1 answer
  • After modifying the font of the Subheading1 style, you notice that the font of Subheading2 has also changed. What is the most li
    12·2 answers
  • Which of the following is a potential hazard
    12·2 answers
  • Write a perl program that reads from a file containing a list of names and then displays that list to a user. The program should
    11·1 answer
  • Which of the following are NOT possible using the RANDOM(a, b) and DISPLAY(expression) abstractions?
    10·1 answer
  • The type of memory that stores data<br>Currently in used is called​
    8·2 answers
  • What are building blocks? Select three options.
    14·1 answer
  • You are configuring a network and have been assigned the network address of 221.12.12.0. You want to subnet the network to allow
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!