C program to find the kth smallest element : Given anyarbitrary array of numbers of size N, and any integer k. Develop aprogram to read such an array and the value of k, and to find the kthsmallest number in that array subject to the following
(i)Time complexity is O(N)and space complexity is at most O(N).
(ii)Size of array will be read from user, and memory will be allocateddynamically for the array.
(iii)The program will be menu-driven – there will be an option to eitherread the array elements from user, or to populate the array withrandom numbers.
(iv)Your program must be as efficient/smart as possible – as a hint –finding (N – 1)th smallest element in an array of size N isequivalent to finding the 2ndlargest element in that array.