New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Algorithms Design And Analysis

by: Kavon Reynolds

Algorithms Design And Analysis CS 422

Marketplace > Northern Michigan University > ComputerScienence > CS 422 > Algorithms Design And Analysis
Kavon Reynolds
GPA 3.72

Michael Kowalczyk

Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Michael Kowalczyk
Class Notes
25 ?




Popular in Course

Popular in ComputerScienence

This 1 page Class Notes was uploaded by Kavon Reynolds on Thursday October 15, 2015. The Class Notes belongs to CS 422 at Northern Michigan University taught by Michael Kowalczyk in Fall. Since its upload, it has received 34 views. For similar materials see /class/224055/cs-422-northern-michigan-university in ComputerScienence at Northern Michigan University.


Reviews for Algorithms Design And Analysis


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/15/15
Algorithm Design and Analysis 2252008 Lecture 19 Linear time selection Instructor Mike Kowalczyk 1 Linear time selection 11 De ne the problem First let s de ne the problem carefully Selection problem lnput Array of n elements and index 0 g k g n 7 1 Output Returns AM where A is the sorted version of A Note that our problem de nition doesn t necessarily say that we actually sort the array it s just a way of specifying the output 12 Divide and conquer algorithm Our idea starts with grouping the n elements in sets of 5 each Then sort each group of 5 take the median of each of group of 5 and recursively nd the median of those medians of 5 Now we know that the median of medians is going to be greater than approximately 37110 elements Similarly it s less than 37110 elements so the median of medians is somewhere from the 310 mark to the 710 mark Because of this we can use the median of medians as a pivot and split up the remaining work just like Quicksort The fact that the pivot is roughly in the middle means that it should be fast but we ll prove this to make sure selectionarray A index k Group A into sets of 5 elements each Sort each set of 5 Let M be the set of medians of those sets of 5 if M is size 1 return MO p selectionM Mlength 2 finds the median of M Use the pivot p to split A into arrays S and B Let S the elements of A that are smaller than p Let B the elements of A that are bigger than p if ISI k ISI denotes the number of elements in S return p else if k lt Isl return selectionS k else k gt ISI


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

Janice Dongeun University of Washington

"I used the money I made selling my notes & study guides to pay for spring break in Olympia, Washington...which was Sweet!"

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.