Find Kth Largest Or Smallest Element In Unsorted Array | Most Efficient | Data Structures Interview

preview_player
Показать описание
This video is prepared by a computer science engineering (BTech) from IIT Madras.
#datastructures #datastructureinterview #interviewpreparation #asappjobs

Given an unsorted array and a number k where k is smaller than the size of the array, we need to find the k’th largest element in the given array. It is given that all array elements are distinct.

Time complexity of the solution is O(N) which we achieved using Quick Select algorithm.
and to handle worst time complexity we can use randomized Quick Select or Median of medians algorithm.

----------------------------------

more data structure interview questions:
Find Kth Largest Or Smallest Element In Unsorted Array [Part 2] | Data Structure Interview Questions

Find Pythagorean Triplet In Unsorted Array | Data Structure Interview Questions

Special Stack With GetMin Function In Constant Time Complexity | Data Structure Interview Questions

Reverse Every K Nodes of Linked List [Part 1] | Data Structure Interview Questions

Reverse Every K Nodes of Linked List [Part 2] | Data Structure Interview Questions | How To Code

Reverse Every K Nodes of Linked List [Part 3] | Data Structure Interview Questions | How To Code

Find Median of Two Sorted Arrays of Different Sizes [Part 1] | Data Structure Interview Questions

-----------------------------

About AsappJobs:

For more details please visit:

___________________

Visit to our playlist for more interesting videos:

Data Structures & Algorithms Complete Course 2020 🔥 (Designed To Crack Interviews):

System Design By Industry Experts:

System Design Mini Series By Experts:

How To Crack Graph Interview:

System Design Interview Preparation:

Hands On With Microsoft Azure:

Cloud Computing:

Interview With Selected Candidate:

Interview Tips And Questions By Selected Candidate:

Java Interview Questions & Answers:

Java Fundamentals And Internal Mechanism:

Data Structure And Algorithms Interview Questions And Answers:

Data Structure And Algorithms Interview Q&A (Quick Prep):

Interview Puzzles:

Interview Preparation Complete Guidelines:

Data Structure and Algorithms Full Course:
––––––––––––––––––––––––––––
contact details:

–––––––––––––––––––––––––––––

Please like, comment and share this video to your network
and don't forgot to subscribe and hit the bell icon ;)

Thanks,
AsappJobs Team
Рекомендации по теме
Комментарии
Автор

Please explain why median of median will help reduce the complexity as compared to Randomized Quick Sort ???

inclinedscorpio
Автор

This is definitely not the most efficient as the worst case time complexity is O(n^2). Could you consider using PriorityQueue?

algorithmimplementer