Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7177631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:45:17+00:00 2026-05-28T16:45:17+00:00

Section 9.3 in CLRS 3rd edition Selection in worst-case linear time talks about the

  • 0

Section 9.3 in CLRS 3rd edition “Selection in worst-case linear time” talks about the “Select” algorithm (sometimes called the BFPRT algorithm due to Blum, Floyd, Pratt, Rivest, and Tarjan) for finding the median of a list in O(n) time at worst case. I got a little confused as I tried to run a sample on the whiteboard. I understand that a certain number of elements can be eliminated at each call to “Select” (I have read 30% are eliminated versus 70% that need to be checked again), what I was confused about was which part of the array can be eliminated, i.e. if the array is visualized as a matrix with height 5 and width n/5, then which quadrant(s) do the eliminated elements rest in? I originally thought it was two diagonally adjacent quadrants but now I am thinking it is only one quadrant depending on what the median of medians is (see steps 5, 6, and 7 here).

So I went to wikipedia to see if there was a quick explanation with less analysis than CLRS (for the sake of understanding the algorithm before I jumped back to CLRS for the analysis). I came to this, particularly ‘Finally, the “median of medians’ is chosen to be the pivot.” from the sound of the description in wikipedia, “Select” does not find the true median rather a element that is median-enough for the purpose of choosing a pivot for quicksort.

So what does “Select” do in terms of the true median, and how does it do it? The phrase that comes to mind through all of this is “partial hierarchy”, which as I understand, is the reason “Select” works, but by what logic can you eliminate elements from the list from being the median based on this partial hierarchy?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:45:18+00:00Added an answer on May 28, 2026 at 4:45 pm

    It finds the absolute median.

    As you said, “Select” does not find the true median rather a element that is median-enough for the purpose of choosing a pivot for quicksort. In particular it is median enough that it is guaranteed to drop at least 30% of the dataset on every iteration. Unfortunately it is also an expensive operation.

    The key idea is that the median of medians is less than or equal to 3 out of every 5 elements whose median is less than or equal to it. So it is less than or equal to 3 out of every 5 elements for half the groups of 5, so at least 30% of the set is less than or equal to it. So it is in the largest 70% of the data set.

    Similarly it is in the smallest 70% of the data set.

    This guarantees that you avoid the potential pitfall of quickselect, which is picking pivot points that have extreme values.

    If you wish to combine efficiency and a good worst case you can combine this with quickselect. For instance 4 rounds of quickselect followed by one round of this followed by 4 rounds of quickselect, etc. The expensive rounds of BFPRT guarantee O(n) while the quickselect on average is going to be fast. By putting off your first round of BFPRT until you’ve done several rounds of quickselect you can make the extra running time only a few percent more than quickselect on average. (The worst case cost goes up by quite a bit, but we don’t expect to encounter that.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In section 15.12.2.5 of the Java Language Specification , it talks about how to
See section /* Common Classes */ of this page. http://webdesign.about.com/od/css/a/master_stylesht_2.htm are these css classes
For the about section of my app, I want to display some multiline text.
I have a Section in my website called Recent Updates. in that I will
From section 3.13.3 of the curry tutorial : Operations that residuate are called rigid
Section 7.1 of the C++ Standard mentions about 'extern' as a storage class specifier.
.section .data astring: .asciz 11010101 format: .asciz %d\n .section .text .globl _start _start: xorl
.section .data msgI: .ascii x = y\n msgI_end: msgM: .ascii x > y\n msgM_end:
The section Last links in the chain: Stashing and the reflog in http://ftp.newartisans.com/pub/git.from.bottom.up.pdf recommends
In section 10.4, The Definitive ANTLR reference tells you to override mismatch() & recoverFromMismatchedSet()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.