ankitapuri / DSA-guide

Trying to cover important DSA
MIT License
49 stars 114 forks source link

Added p’th Smallest/Largest Element in Unsorted Array in cpp #265

Open msbuddhu opened 3 years ago

msbuddhu commented 3 years ago

Related Issues

Closes: #[issue number that will be closed through this PR]

Describe the changes you've made

Given an array and a number p where p is smaller than size of array, we need to find the p’th smallest element in the given array. It is given that all array elements are distinct. I have added the solution in c++.

Type of change

How Has This Been Tested?

Yes.

Describe if there is any unusual behaviour of your code(Write NA if there isn't)

NA

Checklist:

Screenshots

Original Updated
original screenshot updated screenshot
msbuddhu commented 3 years ago

I have contributed to issue #265. Please take a look.