The Wayback Machine - https://web.archive.org/web/20241225114251/https://www.geeksforgeeks.org/videos/sde-sheet-kth-smallest-element/
  • Courses
  • Tutorials
  • DSA
  • Data Science
  • Web Tech
April 23, 2024 |420 Views

SDE Sheet - K’th smallest element

  Share   Like
Description
Discussion

This video is part of Searching and Sorting section under GFG SDE Sheet.

In this problem, we are an array arr[] and an integer k where k is smaller than the size of the array, the task is to find the kth smallest element in the given array. It is given that all array elements are distinct.

Note:-  l and r denotes the starting and ending index of the array.

Example :

Input:
n = 6
arr[] = 7 10 4 3 20 15
k = 3
l=0 r=5

Output : 
7

Explanation :
3rd smallest element in the given array is 7.

Try it out before watching the implementation of the problem in the video. We recommend watching the video, even if you can solve the problem. You may discover something new. All the best!!!

Do check out:-
Article: https://www.geeksforgeeks.org/kth-smallest-largest-element-in-unsorted-array/
Problem: https://www.geeksforgeeks.org/problems/kth-smallest-element5635/1
SDE Sheet Link: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/