We are given four segments as a pair of coordinates of their end points. We need to tell whether those four line segments make a rectangle or not. Examples: Inp
Consider a rectangle ABCD, we’re given the co-ordinates of the mid points of side AD and BC (p and q respectively) along with their length L (AD = BC = L). No
Given two arrays X[] and Y[] with n-elements, where (Xi, Yi) represent a point on coordinate system, find the smallest rectangle such that all points from given
The circumference of a figure is the sum of all the side lengths. To calculate the circumference of square, length of one of the side is required as all sides a
A square is a flat shape, in one plane, defined by four points at the four corners. A square has four sides all of equal length, and four corners, all right ang
A rectangle is a flat figure in a plane.It has four sides and four equal angles of 90 degree each.In rectangle all four sides are not of equal length like squar
Given the side of a square then find the area of a Circumscribed circle around it. Examples: Input : a = 6 Output : Area of a circumscribed circle is : 56.55 In
Given coordinates of four points in a plane, find if the four points form a square or not. To check for square, we need to check for following. a) All fours sid
Given the radius(r) of circle then find the area of square which is Circumscribed by circle. Examples: Input : r = 3 Output :Area of square = 18 Input :r = 6 Ou
Given an integer n, calculate square of a number without using *, / and pow(). Examples : Input: n = 5 Output: 25 Input: 7 Output: 49 Input: n = 12 Output: 144
We have given a spiral matrix of odd-order, in which we start with the number 1 as center and moving to the right in a clockwise direction. Examples : Input : n
Given an N x N matrix, find a k x k submatrix where k <= N and k >= 1, such that sum of all the elements in submatrix is maximum. The input matrix can contain z
Given a square matrix, swap the element of major and minor diagonals. Major Diagonal Elements of a Matrix : The Major Diagonal Elements are the ones that occur
Given a square matrix, find out count of numbers that are same in same row and same in both primary and secondary diagonals. Examples : Input : 1 2 1 4 5 2 0 5
Prerequisite : Introduction and DFS The task is to find LCA of two given nodes in a tree (not necessarily a Binary Tree). In previous posts, we have seen how to
We have an array arr[0 . . . n-1]. We should be able to efficiently find the minimum value from index L (query start) to R (query end) where 0 <= L <= R <= n-1.
Sqrt (or Square Root) Decomposition Technique is one of the most common query optimization technique used by competitive programmers. This technique helps us to
Let us consider the following problem to understand MO’s Algorithm. We are given an array and a set of query ranges, we are required to find the sum of every
Problem – Write an assembly language program in 8086 microprocessor to find square root of a number. Example – Algorithm – Move the input data in register
Prerequisite – 8086 program to find Square Root of a number Problem – Write a program to find the square root of a perfect number where starting address for
Problem – Write an assembly language program in 8085 microprocessor to find square root of a number. Example – Assumptions – Number, whose square root we
Problem – Write an assembly language program in 8085 microprocessor to find square of 8 bit number. Example – Assumption – Addresses of input data and out
rectangle() is used to draw a rectangle. Coordinates of left top and right bottom corner are required to draw the rectangle. left specifies the X-coordinate of
Mathematical functions are present in SQL server which can be used to perform mathematical calculations. Some commonly used mathematical functions are given bel
Prerequisite – PL/SQL introduction In PL/SQL code groups of commands are arranged within a block. A block group related declarations or statements. In declare