Sometimes we visit some e-commerce website and check some product there and leave the website without placing order. Then when we open Facebook, we see… Read More »

## How to parse JSON in Java

JSON (JavaScript Object Notation) is a lightweight, text-based, language-independent data exchange format that is easy for humans and machines to read and write. JSON can… Read More »

## Java.lang.StrictMath class in Java | Set 2

Java.lang.StrictMath Class in Java | Set 1 More methods of java.lang.StrictMath class exp() : java.lang.StrictMath.exp(double arg) method returns the Euler’s number raised to the power… Read More »

## Java.lang.StrictMath class in Java | Set 1

StrictMath Class methods helps to perform the numeric operations like square, square root, cube, cube root, exponential and trigonometric operations Declaration : public final class… Read More »

## Cassini’s Identity

Given a number N, the task is to evaluate below expression. Expected time complexity is O(1). f(n-1)*f(n+1) – f(n)*f(n) Where f(n) is the n-th Fibonacci… Read More »

## Count numbers with difference between number and its digit sum greater than specific value

Given a positive value N, we need to find the count of numbers smaller than N such that the difference between the number and sum… Read More »

## Bitmasking and Dynamic Programming | Set-2 (TSP)

In this post, we will be using our knowledge of dynamic programming and Bitmasking technique to solve one of the famous NP-hard problem “Travelling Salesman… Read More »

## new vs operator new in C++

When you create a new object, memory is allocated using operator new function and then the constructor is invoked to initialize the memory. Here, The… Read More »

## Find if a number is divisible by every number in a list

Given a list and a number task is to find the number which is divided by every element of the list. Examples : Input :… Read More »

## Find and print duplicate words in std::vector<string> using STL functions

Consider an array of string and find duplicate words in that array and print that duplicate words if exist. Examples: Input : { “welcome”, “to”,… Read More »

## Find a range of composite numbers of given length

Given an integer n, we need to find a range of positive integers such that all the number in that range are composite and length… Read More »

Quadtrees are an effective method to store and locate data of points in a two-dimensional plane. Another effective use of quadtrees is in the field… Read More »

## Number of pairs in an array such that product is greater than sum

Given a array a[] of non-negative integers. Count the number of pairs (i, j) in the array such that a[i] + a[j] < a[i]*a[j]. (the… Read More »

## Search an element in an unsorted array using minimum number of comparisons

Given an array of n distinct integers and an element x. Search the element x in the array using minimum number of comparisons. Any sort… Read More »

## Count pairs (a, b) whose sum of cubes is N (a^3 + b^3 = N)

Given N, count all ‘a’ and ‘b’ that satisfy the condition a^3 + b^3 = N. Examples: Input : N = 9 Output : 2… Read More »