Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

Latest commit

 

History

History
executable file
·
17 lines (8 loc) · 387 Bytes

Quick_Select.md

File metadata and controls

executable file
·
17 lines (8 loc) · 387 Bytes

Quick Select

Problem Statement

Write a function that takes in an array of distinct integers as well as an integer k and returns the kth smallest number in that array in linear time, on average. The array could be sorted, but isn't necessarily so.

Sample input: [8, 5, 2, 9, 7, 6, 3], 3

Sample output: 5

Solution

Check this Python code.