filmov
tv
Leetcode 215 | Kth largest/Kth smallest element in array| PriorityQueue in Java | Brute Force|

Показать описание
How to find Kth largest and Kth smallest element in an array?
Using 2 approaches
1. By Brute force approach(TC - 0( N logN) & space complexity - O(1))
2. By using priorityQueue( TC - O(N logK) & space complexity - O(K))
TimeStamps:
0:00 using brute force approach
5:34 using priorityQueue
#priorityqueue #arraysinjava #array #leetcodesolution #leetcode #coding #leetcode #programminglife #programmingisfun #programmer #tech #software #codinglife #leetcode
Using 2 approaches
1. By Brute force approach(TC - 0( N logN) & space complexity - O(1))
2. By using priorityQueue( TC - O(N logK) & space complexity - O(K))
TimeStamps:
0:00 using brute force approach
5:34 using priorityQueue
#priorityqueue #arraysinjava #array #leetcodesolution #leetcode #coding #leetcode #programminglife #programmingisfun #programmer #tech #software #codinglife #leetcode