## Maximum number of chocolates to be distributed equally among k students

Given n boxes containing some chocolates arranged in a row. There are k number of students. The problem is to distribute maximum number of chocolates… Read More »

## Postorder traversal of Binary Tree without recursion and without stack

Prerequisite – Inorder/preorder/postorder traversal of tree Given a binary tree, perform postorder traversal. Recommended: Please try your approach on {IDE} first, before moving on to… Read More »

## Minimum equal palindromic cuts with rearrangements allowed

Given a string of length n. Find the minimum number of possible cuts after rearranging the string (if required), such that each cut is a… Read More »

## First non-repeating in a linked list

Given a linked list, find its first non-repeating integer element. Examples: Input : 10->20->30->10->20->40->30->NULL Output :First Non-repeating element is 40. Input :1->1->2->2->3->4->3->4->5->NULL Output :First Non-repeating… Read More »

## Minimum number of subsets with distinct elements

You are given an array of n-element. You have to make subsets from the array such that no subset contain duplicate elements. Find out minimum… Read More »

## Count subarrays with equal number of 1’s and 0’s

Given an array arr[] of size n containing 0 and 1 only. The problem is to count the subarrays having equal number of 0’s and… Read More »

## Change the array into a permutation of numbers from 1 to n

Given an array A of n elements. We need to change the array into a permutation of numbers from 1 to n using minimum replacements… Read More »

## Longest subarray with sum divisible by k

Given an arr[] containing n integers and a positive integer k. The problem is to find the length of the longest subarray with sum of… Read More »

## Smallest subarray with all occurrences of a most frequent element

Given an array, A.Let x be an element in the array.x has the maximum frequency in the array.Find the smallest subsegment of the array which… Read More »

## File Organization in DBMS | Set 2

Prerequisite – Hashing Data Structure In database management system, When we want to retrieve a particular data, It becomes very inefficient to search all the… Read More »

## Maximum distinct elements after removing k elements

Given an array arr[] containing n elements. The problem is to find maximum number of distinct elements (non-repeating) after removing k elements from the array.… Read More »

## Print n smallest elements from given array in their original order

We are given an array of m-elements, we need to find n smallest elements from the array but they must be in the same order… Read More »

## Game of replacing array elements

There are two players A and B who are interested in playing a game of numbers. In each move a player pick two distinct number,… Read More »

## Minimum cost to construct a string

Given a string s (containing lowercase letters only), we have to find the minimum cost to construct the given string. The cost can determined using… Read More »

## Length of longest strict bitonic subsequence

Given an array arr[] containing n integers. The problem is to find the length of the longest strict bitonic subsequence. A subsequence is called strict… Read More »