## Summed Area Table – Submatrix Summation

Given a matrix of size M x N, there are large number of queries to find submatrix sums. Inputs to queries are left top and… Read More »

## Minimum number of swaps required to sort an array

Given an array of n distinct elements, find the minimum number of swaps required to sort the array. Examples: Input : {4, 3, 2, 1}… Read More »

## Minimum number of operation required to convert number x into y

Given a initial number x and two operations which are given below: Multiply number by 2. Subtract 1 from the number. The task is to… Read More »

## Hexagonal Number

Given an integer n, the task is to find the n’th hexagonal number . The n’th hexagonal number Hn is the number of distinct dots… Read More »

## EnumMap class in Java

EnumMap is specialized implementation of Map interface for enumeration types. It extends AbstractMap and implements Map Interface in Java. Few important features of EnumMap are… Read More »

## Maximum sum of distinct numbers with LCM as N

Given a number N, the task is to find out maximum sum of distinct numbers such that the Least Common Multiple of all these numbers… Read More »

## Find pairs with given sum in doubly linked list

Given a sorted doubly linked list of positive distinct elements, the task is to find pairs in doubly linked list whose sum is equal to… Read More »

## Morgan Stanley Interview | Set 26 (Off-Campus)

Round 1: (Online Coding contest on Hackerrank ) Time -24 hours There were 6 questions of increasing level of difficulty. https://www.hackerrank.com/contests/morgan-stanley-2015/challenges I think Top 150… Read More »

## Opencv Python program for Face Detection

The objective of the program given is to detect object of interest(face) in real time and to keep tracking of the same object.This is a… Read More »

## Powerful Number

A number n is said to be Powerful Number if for every prime factor p of it, p2 also divides it. For example:- 36 is… Read More »

## Time Complexity of a Loop when Loop variable “Expands or Shrinks” exponentially

For such cases, time complexity of the loop is O(log(log(n))).The following cases analyse different aspects of the problem. Case 1 : for (int i =… Read More »

## Character Stream Vs Byte Stream in Java

I/O Stream A stream is a method to sequentially access a file. I/O Stream means an input source or output destination representing different types of… Read More »

## Conversion of Array To ArrayList in Java

Following methods can be used for converting Array To ArrayList: Method 1: Using Arrays.asList() method Syntax: public static List asList(T… a) // Returns a fixed-size… Read More »

## Collections.singleton() method in Java with example

java.util.Collections.singleton() method is a java.util.Collections class method. It creates a immutable set over a single specified element. An application of this method is to remove… Read More »