Physics, asked by samtara1566, 1 year ago

Find the kth smallest element in an unsorted array of non-negative integers.Using constant extra space. Do not modify the list

Answers

Answered by harshitsharmanothing
1

Given an array and a number k where k is smaller than size of array, we need to find the k’th smallest element in the given array. It is given that ll array elements are distinct.


Examples:


Input: arr[] = {7, 10, 4, 3, 20, 15}

k = 3

Output: 7


Input: arr[] = {7, 10, 4, 3, 20, 15}

k = 4

Output: 10

Similar questions