## A program to check if a binary tree is BST or not

Problem Statement “A program to check if a binary tree is BST or not” states that you are given a binary tree and you need to check if the binary tree satisfies the properties of the binary search tree. So, the binary tree has the following properties:  The left subtree …

## Numbers with prime frequencies greater than or equal to k

Problem Statement Problem “Numbers with prime frequencies greater than or equal to k” states that you are given an array of integers size n and an integer value k. All the numbers inside it are prime numbers. The problem statement asks to find out the numbers which appear in the …

## Find pairs with given sum such that elements of pair are in different rows

Problem Statement “Find pairs with given sum such that elements of pair are in different rows” problem states that you are given a matrix of integers and a value called “sum”. The problem statement asks to find out all the pairs in a matrix that sums up to a given …

## Word Wrap Problem

Problem Statement The word wrap problem states that given a sequence of words as input, we need to find the number of words that can be fitted in a single line at a time. So, for doing this we put breaks in the given sequence such that the printed document …

## Size of The Subarray With Maximum Sum

Problem Statement You are given an array of integers. The given array can contain both positive and negative numbers. Find out the size of the subarray with maximum sum. Example arr[] = {1,4,-2,-5,2-1,4,3} 4 Explanation: 2 -1 + 4 + 3 = 8 is maximum sum of length 4 arr[] …

## Reversing a Queue

In Reversing a Queue problem we have given a queue, write an algorithm to reverse the queue. Examples Input queue = 10 -> 8 -> 4 -> 23 Output queue = 23->4->8->10 Input queue = 11 -> 98 -> 31 -> 42 -> 73 -> 6 Output queue = 6 …

## Find the Only Repetitive Element Between 1 to N-1

In finding the only repetitive element between 1 to N-1 problem we have given an array of random integers within a range from 1 to n-1. There will be one number that is repeated. Your task is to find that number. Example Input [2,3,4,5,2,1]A Output 2 Explanation 2 is the …

## Check if String Follows Order of Characters by a Pattern or not

Problem Statement In the “Check if String Follows Order of Characters by a Pattern or not” problem we have to check if characters in the given input string follow the same order as determined by characters present in the given input pattern then print “Yes” else print “No”. Input Format …

## Compare Two Version Numbers

Problem Statement Given two input strings, which are in form of version numbers. A version number looks like a.b.c.d where a, b, c, d are integers. Therefore, the version number is a string in which numbers are separated by dots. We need to compare the two strings (version numbers) and …

## Print all Possible Combinations of R Elements in a given Array of size N

Problem Statement In the “Print all Possible Combinations of R Elements in a given Array of size N” problem, we have given an array of size n. Find all combinations of size r in the array. Input Format Th first and only one line containing an integer N. Second-line containing …

Translate »