Kth Smallest | GFG POTD | C++ | Java | Code Kar Lo

preview_player
Показать описание
Given 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.

Follow up: Don't solve it using the inbuilt sort function.

0:00 Introduction
0:13 Problem Statement
1:48 Explanation
4:53 C++ Code
6:48 Java Code

gfg potd
gfg potd today
gfg problem of the day
potd gfg
potd
potd today
gfg

#dsa #datastructures #algorithm #gfg #potd #coding #array #strings #tree #binarysearchtree #codekarlo #dynamicprogramming
Рекомендации по теме
Комментарии
Автор

nycc .. just a suggestion try to explain gfg/ leetcode contest solutions . ur views will also go up . THANKYOU

amardeep
Автор

k<=0, is the better condition, it's fine here as gfg has given unique elements..

aizadiqbal
Автор

Thanks for Guiding me through your video, I always watch your video even i solve question myself .
As, Always there is a new thing to learn from your video

AyushKumar-idnp
Автор

Hello Sir, we can do the same problem in O(N), using Quickselect Algorithm, Thanks for the great explanation.

gautamjangir
Автор

I have one doubt why we are traversing array index from i=1 instead of i=0 in the last loop, since array indexing always start from 0..please clear..

utkarshbajpayee