Given a sequence of Words and the Order of the alphabet. The order of the alphabet is some permutation of lowercase letters. The task is… Read More »

Given a Binary String of length . It is allowed to do at most one swap between any 0 and 1. The task is to… Read More »

Prerequisite: Dijkstra’s shortest path algorithm Given an adjacency matrix graph representing paths between the nodes in the given graph. The task is to find the… Read More »

DATA COMPRESSION AND ITS TYPES Data Compression, also known as source coding, is the process of encoding or converting data in such a way that… Read More »

Given a binary search tree. The task is to print all odd nodes of the binary search tree. Examples: Input : 5 / \ 3… Read More »

Function overloading and overriding is the OOPs feature in PHP. In function overloading, more than one function can have same method signature but different number… Read More »

50 coins are lined up on a table (initially all heads facing upwards). 50 people pass from the coins one by one in the following… Read More »

Given two integers and and an array arr[] every element of which at index is calculated as arr[i] = i * (-1)i. The task is… Read More »

Given an array A[] of integers. In one move you can choose any element A[i], and increment it by 1. The task is to return… Read More »

Berkeley’s Algorithm is a clock synchronization technique used in distributed systems. The algorithm assumes that each machine node in the network either doesn’t have an… Read More »

Given integers M, N and K, the task is to place K knights on an M*N chessboard such that they don’t attack each other. The… Read More »

Given a binary array( consider it as cyclic with start and end tied together) of length N having only one’s and zero’s where . The… Read More »

List is equivalent to arrays in other languages, with the extra benefit of being dynamic in size. In Python, list is a type of container… Read More »

In Java, there are two types of threads: Daemon Thread User Thread Daemon threads are low priority threads which always run in background and user… Read More »

The !important property in CSS is used to provide more weight (importance) than normal property. In CSS, the !important means that “this is important”, ignore… Read More »

Given an integer K and two arrays A1 and A2, the task is to return the total number of pairs (one element from A1 and… Read More »

Given a binary tree and a number, return true if the tree has a root-to-leaf path such that product of all the values along that… Read More »

Given an array of integers where . In one operation you can either Increment/Decrement any element by 1. The task is to find the minimum… Read More »

Given an integer N. The task is to count the number of ordered pairs (a, b) such that . Examples: Input: N = 5 Output:… Read More »

Given an array A[] of integers. The task is to find the total number of ordered pairs of positive integers (X, Y) such that X… Read More »