## Binary Tree to Binary Search Tree Conversion using STL set

Given a Binary Tree, convert it to a Binary Search Tree. The conversion must be done in such a way that keeps the original structure… Read More »

## C++ programming and STL facts

Assign value by a pair of {} to a container filter_none edit close play_arrow link brightness_4 code // Lots of programmers write code  // like… Read More »

## Print Binary Tree levels in sorted order | Set 2 (Using set)

Given a tree, print the level order traversal in sorted order. Examples : Input : 7 / \ 6 5 / \ / \ 4… Read More »

## set::clear in C++ STL

Sets are a type of associative containers in which each element has to be unique, because the value of the element identifies it. The value… Read More »

## set::begin() and set::end() in C++ STL

Sets are a type of associative containers in which each element has to be unique, because the value of the element identifies it. The value… Read More »

## set::erase in C++ STL

Sets are a type of associative containers in which each element has to be unique, because the value of the element identifies it. The value… Read More »

## set::empty() in C++ STL

Sets are a type of associative containers in which each element has to be unique, because the value of the element identifies it. The value… Read More »

## set::size() in C++ STL

Sets are containers that store unique elements following a specific order. Internally, the elements in a set are always sorted. Sets are typically implemented as… Read More »

## set::swap() in C++ STL

Sets are a type of associative containers in which each element has to be unique, because the value of the element identifies it. The value… Read More »

## Missing Permutations in a list

Given a list of permutations of any word. Find the missing permutation from the list of permutations. Examples: Input : Permutation_given[] = {“ABCD”, “CABD”, “ACDB”,… Read More »

## set::emplace() in C++ STL

Sets are a type of associative containers in which each element has to be unique, because the value of the element identifies it. The value… Read More »

## Maximum Unique Element in every subarray of size K

Given an array and an integer K. We need to find the maximum of every segment of length K which has no duplicates in that… Read More »

## Minimum Possible value of |ai + aj – k| for given array and k.

You are given an array of n integer and an integer K. Find the number of total unordered pairs {i, j} such that absolute value… Read More »

## Counting Inversions using Set in C++ STL

Inversion Count for an array indicates – how far (or close) the array is from being sorted. If array is already sorted then inversion count… Read More »

## Set in C++ Standard Template Library (STL)

Sets are a type of associative containers in which each element has to be unique, because the value of the element identifies it. The value… Read More »