WAP to find Kth smallest and largest element in an array.
Example:
input:
arr[]={12,456,23,45,67,89,50,20}
k=2
Output:
2nd smallest = 29
2nd largest = 89
Published By : Kopal Jaiswal
WAP to find Kth smallest and largest element in an array.
Example:
input:
arr[]={12,456,23,45,67,89,50,20}
k=2
Output:
2nd smallest = 29
2nd largest = 89