There are n points and each point enclose with x and y axis
form a rectangle and find the point using a program which
forms the smallest rectangle?
Answer / Arun Tiwari
To find the point that forms the smallest rectangle among a set of given points, you can use the following steps:
1. Sort the points based on their x-coordinates and then tie breaks based on y-coordinates. This ensures that the points are arranged in ascending order of their x-coordinates and within each group, they are ordered according to their y-coordinates.
2. Initialize a variable `minArea` to store the minimum area rectangle formed so far. Initially set it to an extremely large number.
3. For each group of points with identical x-coordinate, iterate over the points within that group and find the pair of points that form the smallest rectangle. The formula for the area of a rectangle is `area = |(x2 - x1) * (y2 - y1)|`. Update `minArea` if the calculated area is smaller than the current minimum.
4. After iterating through all groups, return the point that forms the smallest rectangle with the minimum area.
| Is This Answer Correct ? | 0 Yes | 0 No |
why not overloading -,=,_,\ operator
Why DG Set manufacturers do not give options for alternative fuels. They even do not allow to change at the cost of custmers.
Anyone have thesis paper about "Electrical Load Forecasting" . Or the web addresses where people usually upload their thesis paper except IEEE.
what is far pointer?
sir, i am khalidh iam preparing for the examinations of Hpcl information systems officers for that iam having a guidence for the written exam.So provide me a test apptitude papers and subject related questions.
if a customer's blackberry stopped syncing their calendar wirelessly what would you do?if a customber deleted mail from his blackberry but it did delete from his mailbox how would ypu resolve this
how to reuse an outdated laptop?
What is CRC? the material will be used in electrical stampings.
how the aeroplane protected from the lightening?
The old welding machine use electro- -magnetic winding to step up the current for welding rods,what is new principle inside the welding
I m doing btech with computerscience branch.For every campus placement eligibilty criteriais is 60%.I have 65% in highschool and b.tech till now but secured 59.6% in intermediate. So would this percentage b considered as 60% or i wont b able to sit in exams?kindly post your views?
What is Symbian.?
Civil Engineering (5086)
Mechanical Engineering (4453)
Electrical Engineering (16638)
Electronics Communications (3918)
Chemical Engineering (1095)
Aeronautical Engineering (239)
Bio Engineering (96)
Metallurgy (361)
Industrial Engineering (259)
Instrumentation (3014)
Automobile Engineering (332)
Mechatronics Engineering (97)
Marine Engineering (124)
Power Plant Engineering (172)
Textile Engineering (575)
Production Engineering (25)
Satellite Systems Engineering (106)
Engineering AllOther (1379)