Rearrange Array’s Even and Odd values in Ascending order C++

In this post we will understand the problem of rearranging the array’s even and odd values in Ascending order, then we will discuss the best possible approach and then write a C++ code to implement the solution. Let’s discuss the problem: Given: An array of integers with equal number of even and odd values. Problem: … Read more

Sort even number in ascending order and odd number in descending order C++

Given: An array of integers containing even and odd numbers. Problem: For the given array sort even number in ascending order and then sort all the odd numbers in descending order. Then arrange odd numbers first and then arrange the even numbers. Examples: Input : arr[] = {1, 2, 3, 5, 4, 7, 10} Output : … Read more