In Matrix Chain Multiplication problem we have to find an optimal solution to multiply given matrices. The problem is not multiply the matrices but to find the sequence of matrix … Continue Reading

## Check if a line Intersect or Touches a Circle

Check if a line Intersect or Touches a Circle

It is a very easy math problem, give an equation of a line, a radius of a circle and its center … Continue Reading

## Reverse words in a String

The problem is we have a string and we have to reverse each word in a string. We have to write a program for the same.

… Continue Reading

## Program to Print LEADERS in an Array

**LEADER** in an array is an element which is greater than all element to its right side. Below are the methods and their implementation is given to print LEADERS in … Continue Reading

## Length of longest consecutive 1s in Binary Representation

Given a decimal number, we have to print the length of longest consecutive 1s in binary representation.

for example, if we have 55 the binary representation will be 110111. So … Continue Reading

## Returned values of printf() and scanf()

Returned values of printf() and scanf()

In C, printf() is used to print, and scanf() is used to read data.

Value returned by **printf()** is the number of characters successfully … Continue Reading

## Program to print Boundary nodes of Binary Tree – Boundary Traversal of Binary Tree

In this post we are going to write a program which will print the boundary nodes of a binary tree. Also known as boundary traversal of binary tree.

Boundary nodes … Continue Reading

## Midpoint Circle Algorithm in C and C++

Midpoint circle algorithm is an algorithm used to draw circle in computer graphics. In below post you will find program for midpoint circle algorithm in C and C++.

To run … Continue Reading

## Bresenham’s Line Drawing Algorithm in C and C++

Bresenham’s Line Drawing Algorithm in C and C++

Below is the implementation of Bresenham’s Line Drawing Algorithm in C and C++. The algorithm is used to draw a line. We … Continue Reading

## C++ and Java Program to Add Two Time object

C++ and Java Program to Add Two Time object

WAP in C++ & Java to declare a class Time with data members mm for minutes, ss for seconds and hh … Continue Reading