Altitude of largest Triangle that can be inscribed in a Rectangle
Given a rectangle of length L and breadth B, the task is to print the maximum integer altitude possible of the largest triangle that can be inscribed in it, such that the altitude of the triangle should be equal to half of the base....
read more
Biggest Reuleaux Triangle inscribed within a square which is inscribed within an ellipse
Given an ellipse with major axis length and minor axis 2a & 2b respectively which inscribes a square which in turn inscribes a reuleaux triangle. The task is to find the maximum possible area of this reuleaux triangle.Examples:...
read more
Area of the largest rectangle formed by lines parallel to X and Y axis from given set of points
Given an array arr[] consisting of N pair of integers representing coordinates of N points, the task is to find the area of the largest rectangle formed by straight lines drawn parallel to X and Y-axis from a given set of points....
read more
Classification of Algorithms with Examples
There are many ways of classifying algorithms and a few of them are shown below:...
read more
Probability that the pieces of a broken stick form a n sided polygon
We have a stick of length L. The stick got broken at (n-1) randomly chosen points (lengths of parts can be non-integer or floating point numbers also) so we get n parts. We need to find the probability that these n pieces can form a n sided polygon. Examples:...
read more
Descartes’ Circle Theorem with implementation
In geometry, Descartes’ theorem states that for every four mutually tangent circles, the radii of the circles satisfy a certain quadratic equation. One can construct a fourth circle tangent to three given, mutually tangent circles. Descartes’ Circle Theorem helps us to find the radius of a circle when there are 4 circles with positive integer radius r1, r2, r3 and r4 as shown in the figure below. It finds the radius r4 of the circle formed by three circles of radius r1, r2, r3 as shown in the image below. (Note that the circles in the picture below are tangent to each other.)...
read more
Count number of triangles possible with length of sides not exceeding N
Given an integer N, the task is to find the total number of right angled triangles that can be formed such that the length of any side of the triangle is at most N....
read more
Find the maximum value of Y for a given X from given set of lines
Given a set of lines represented by a 2-dimensional array arr consisting of slope(m) and intercept(c) respectively and Q queries such that each query contains a value x. The task is to find the maximum value of y for each value of x from all the given a set of lines....
read more
Sum of series 8/10, 8/100, 8/1000, 8/10000. . . till N terms
Given a positive integer n, the task is to find the sum of series...
read more
Number of ordered points pair satisfying line equation
Given an array of n integers, slope of a line i. e., m and the intercept of the line i.e c, Count the number of ordered pairs(i, j) of points where i ? j, such that point (Ai, Aj) satisfies the line formed with given slope and intercept....
read more
Area of a leaf inside a square
Given an integer a as the side of the square ABCD. The task is to find the area of the leaf AECFA inside the square as shown below:...
read more
Geometric Median
In normal median, we find a point that has minimum sum of distances. Similar concept applies in 2-D space. Given N points in 2-D space, the task is to find out a single point (x, y) from which the sum of distances to the input points are minimized (also known as the centre of minimum distance).Examples:...
read more