Question: AMS - Sorting in O ( n ) Languag 1 # Problem Definition: An input array contains only 3 distinct non zero positive numbers. Sort

AMS - Sorting in O(n)
Languag
1
#
Problem Definition:
An input array contains only 3 distinct non zero positive numbers. Sort the array in O(n) time complexity.
Constrain:
Maximum size of array is 100.
Three number are distinct.
Numbers are less than 1000,
Number can be repeated any numbers of time.
Number may not be repeated.
E.g.
Input: 6338633836
Output: 3333366688

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!