Question: Q 2 . Given an array of size n and a range a , b . The task is to partition the array around the
Q Given an array of size n and a range The task is to partition the array around the range such that array is divided into three parts.
All elements smaller than a come first.
All elements in range a to b come next.
All elements greater than b appear in the end.
The individual elements of three sets can appear in any order. You are required to return the modified array.
give the answer in python programming language
Example:
Input:
Size of the array:
Array:
range:
Output:
Modified Array:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
