0% found this document useful (0 votes)
49 views

Prog. assignment 3

Uploaded by

Sake Anila
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

Prog. assignment 3

Uploaded by

Sake Anila
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Programming Assignment 3: Minima, Maxima,

Quickselect, and Median of Medians


Course: CS212 Design and Analysis of Algorithms
September 6, 2024

Objective
The objective of this assignment is to implement algorithms to find the minimum, max-
imum, k-th smallest element using Quickselect, and the median using the Median of
Medians algorithm. You’ll learn about efficient selection algorithms and their practical
applications.

Problem Statement
ˆ Problem Description

– Minima and Maxima: Implement functions to find the minimum and maxi-
mum of an array in O(n) time.
– Quickselect: Implement the Quickselect algorithm to find the k-th smallest
element in an array in expected O(n) time.
– Median of Medians: Implement the Median of Medians algorithm to find the
median of an array in O(n) worst-case time.

Note
ˆ You are expected to work individually on this assignment.

ˆ Plagiarism will not be tolerated. Any suspected plagiarism will result in penalties
as per the course policy.

You might also like