## Rearrange Odd and Even values in Alternate Fashion in Ascending Order

Given an array of integers (both odd and even), the task is to arrange them in such a way that odd and even values come… Read More »

- Sorting a vector in C++
- Merge k sorted arrays | Set 2 (Different Sized Arrays)
- Check if a given graph is Bipartite using DFS
- Minimum number of swaps required to sort an array | Set 2
- Longest subarray having average greater than or equal to x
- Print all pairs in an unsorted array with equal sum
- Minimum cost path from source node to destination node via an intermediate node
- Rearrange Odd and Even values in Alternate Fashion in Ascending Order
- Check if a triplet with given sum exists in BST
- How does a vector work in C++?
- Count unique subsequences of length K
- Lowest Common Ancestor in Parent Array Representation
- Print the DFS traversal step-wise (Backtracking also)
- Count subarrays with Prime sum
- Perform the given queries on the rooted tree
- Find the missing elements from 1 to M in given N ranges | Set-2
- Rearrange all elements of array which are multiples of x in decreasing order
- Minimum number of days required to complete the work
- Count the number of elements in an array which are divisible by k
- Delete array element in given index range [L - R]
- Prime numbers in a given range using STL | Set 2
- Print levels with odd number of nodes and even number of nodes
- Difference between std::swap and std::vector::swap
- Maximum length of rod for Q-th person
- Find four factors of N with maximum product and sum equal to N
- Sort perfect squares in an array at their relative positions
- Find the k-th smallest divisor of a natural number N
- Sorting array elements with set bits equal to K
- Count elements in a vector that match a target value or condition
- Get first and last elements from Array and Vector in CPP

Given an array of integers (both odd and even), the task is to arrange them in such a way that odd and even values come… Read More »

Given a Binary Search Tree and a SUM. The task is to check if there exists any triplet(group of 3 elements) in the given BST… Read More »

Given an array of integers arr[] and an integer x, the task is to sort all the elements of the array which are multiples of… Read More »

Given an N-ary tree, print all the levels with odd and even number of nodes in it. Examples: For example consider the following tree 1… Read More »

Given an integer array , the task is to sort only the elements which are perfect squares at their relative positions in the array (positions… Read More »

Given an integer and ranges (e.g. [a, b]) which are intersecting and overlapping. The task is to find all the number within the range that… Read More »

Given an unsorted array A[]. The task is to print all unique pairs in the unsorted array with equal sum. Note: Print the result in… Read More »

Given an array A[] of integers. The task is to count total subarrays whose sum is prime with ( size > 1 ). Examples: Input… Read More »

Given an array of integers. The task is to calculate the count of a number of elements which are divisible by a given number k.… Read More »

Given an array of integers and a number . The task is to sort only those elements of the array whose total set bits are… Read More »

To determine number of integers in a vector that matches a particular value. We use count in C++ STL filter_none edit close play_arrow link brightness_4… Read More »

A container is a holder object that holds a collection of other objects. They are implemented as class templates, which allows a great flexibility in… Read More »

Given an array, find first and last elements of it. Input: {4, 5, 7, 13, 25, 65, 98} Output: First element: 4 Last element: 98… Read More »

Given a rooted tree and not necessarily binary. The tree contains N nodes, labeled 1 to N. You are given the tree in the form… Read More »

You’re given a number N and a number K. Our task is to find the kth smallest divisor of N. Examples: Input : N =… Read More »