## Adding one to number represented as array of digits

Given a non-negative number represented as an array of digits, add 1 to the number ( increment the number represented by the digits ). The… Read More »

Given a non-negative number represented as an array of digits, add 1 to the number ( increment the number represented by the digits ). The… Read More »

When class member is a vector object (not a reference). We can simply assign in constructor. Output: 1 2 3 4 5 We can also… Read More »

Vectors are same as dynamic arrays with the ability to resize itself automatically when an element is inserted or deleted, with their storage being handled… Read More »

In C++ vectors are dynamic arrays. Unlike arrays, they don’t have a fixed size. They can grow or shrink as required. Vectors are assigned memory… Read More »

These functions return useful iterators to access vector elements in reverse order (from end to beginning) Using vector::crend() It’s a public member function that returns… Read More »

Given an array arr[] and an integer k, we need to print k maximum elements of given array. The elements should printed in the order… Read More »

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

Insertion Sort is suitable for arrays of small size. It also achieves best-case complexity of O(n) if the arrays are already sorted. We have discussed… Read More »

If most of the elements in the matrix are zero then the matrix is called a sparse matrix. It is wasteful to store the zero… Read More »