Tagged articles

quickselect

4 articles · Page 1 of 1
Nullbody Notes
Nullbody Notes
Nov 19, 2023 · Interview Experience

How to Find the Kth Largest Element in an Array Using QuickSort

This article explains how to locate the kth largest element in an array by leveraging quicksort partitioning, showing that the target index equals len(nums)‑k and iteratively narrowing the search range until the element is found, with a complete Go implementation.

Golangalgorithmarray
0 likes · 4 min read
How to Find the Kth Largest Element in an Array Using QuickSort
NiuNiu MaTe
NiuNiu MaTe
Dec 31, 2021 · Fundamentals

Master TopK: From Simple Sorts to Heap and QuickSelect Solutions

This article explains the TopK problem, compares sorting‑based O(nk) approaches with heap‑based O(n + k log n) and quick‑select O(n) methods, and provides complete Java implementations for each technique, helping readers ace interview questions on finding the largest K elements.

HeapSortingquickselect
0 likes · 13 min read
Master TopK: From Simple Sorts to Heap and QuickSelect Solutions
Programmer DD
Programmer DD
Jun 19, 2021 · Fundamentals

How to Find the k‑th Largest Element in an Unsorted Array: 4 Efficient Methods

Learn four practical approaches to locate the k‑th largest element in an unsorted array—including sorting, insertion, min‑heap, and divide‑and‑conquer techniques—complete with step‑by‑step explanations, complexity analysis, and a full Java implementation for algorithmic interview preparation.

javakth largestmin-heap
0 likes · 10 min read
How to Find the k‑th Largest Element in an Unsorted Array: 4 Efficient Methods