## Maximum area of triangle having different vertex colors

Given a matrix of N rows and M columns, consists of three value {r, g, b}. The task is to find the area of the… Read More »

## Possible to form a triangle from array values

Given an array of integers, we need to find out whether it is possible to construct at least one non-degenerate triangle using array values as… Read More »

## Maximum path sum in a triangle.

We have given numbers in form of triangle, by starting at the top of the triangle and moving to adjacent numbers on the row below,… Read More »

## Number of possible Triangles in a Cartesian coordinate system

Given n points in a Cartesian coordinate system. Count the number of triangles formed. Examples: Input : point[] = {(0, 0), (1, 1), (2, 0),… Read More »

## Find all sides of a right angled triangle from given hypotenuse and area | Set 1

Given hypotenuse and area of a right angle triangle, get its base and height and if any triangle with given hypotenuse and area is not… Read More »

## Maximum height when coins are arranged in a triangle

We have N coins which need to arrange in form of a triangle, i.e. first row will have 1 coin, second row will have 2… Read More »

## Classify a triangle

We are given co-ordinates of a triangle. The task is to classify this triangle on basis of sides and angle. Examples: Input : p1 =… Read More »

## Finding the number of triangles amongst horizontal and vertical line segments

Prerequisites: BIT Given ‘n’ line segments, each of them is either horizontal or vertical, find the maximum number of triangles(including triangles with zero area) that… Read More »

## Counting Triangles in a Rectangular space using BIT

Pre-requisite : BIT(Binary Indexed Tree or Fenwick Tree), 2D BIT Given a 2D plane, respond to Q queries, each of the following type: Insert x… Read More »

## Count number of unique Triangles using STL | Set 1 (Using set)

We are given n triangles along with length of their three sides as a,b,c. Now we need to count number of unique triangles out of… Read More »

## Area of a polygon with given n ordered vertices

Given ordered coordinates of a polygon with n vertices. Find area of the polygon. Here ordered mean that the coordinates are given either in clockwise… Read More »

## Triangular Numbers

A number is termed as triangular number if we can represent it in the form of triangular grid of points such that the points form… Read More »

## Number of Triangles in Directed and Undirected Graphs

Given a Graph, count number of triangles in it. The graph is can be directed or undirected. Example: Input: digraph[V][V] = { {0, 0, 1,… Read More »

## Count Integral points inside a Triangle

Given three non-collinear integral points in XY plane, find the number of integral points inside the triangle formed by the three points. (A point in… Read More »

## Number of Triangles in an Undirected Graph

Given an Undirected simple graph, We need to find how many triangles it can have. For example below graph have 2 triangles in it. Let… Read More »