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 4254634
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:06:39+00:00 2026-05-21T05:06:39+00:00

As we can choose median of 3 element partitioning to implement quick sort. Likewise

  • 0

As we can choose median of 3 element partitioning to implement quick sort. Likewise can we choose median of 5, 7, or 11 element to implement quick sort? If so, then how??

  • 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-21T05:06:40+00:00Added an answer on May 21, 2026 at 5:06 am

    You should look into the Median of Medians algorithm. It is a linear time algorithm with the following recurrence…

    T(n) ≤ T(n/5) + T(7n/10) + O(n)
    

    … which is O(n). The algorithm details…

    1. divide the list into n/5 subsequences of 5 elements each
    2. find the median of each list, by brute force. there will be n/5 of these
    3. Let m_1,…, m_n/5 be these medians.
    4. recursively find the median of these medians. this will be 1 element, the pivot!

    … and some pseudo-code…

    MedianOfMedians (A[1],...,A[n]) 
    begin
        for i=1 to n/5 do {
            let m_i be the median of A[5i − 4], A[5i − 3],..., A[5i];
        }
        pivot = Select(m1,...,m_n/5, n/10); // the pivot
        return pivot
    end
    

    References

    • http://en.wikipedia.org/wiki/Selection_algorithm#Linear_general_selection_algorithm_-_Median_of_Medians_algorithm
    • Median of Medians in Java
    • http://www.cs.berkeley.edu/~luca/w4231/fall99/slides/l3.pdf
    • http://www.soe.ucsc.edu/classes/cmps102/Spring05/selectAnalysis.pdf
    • http://webee.technion.ac.il/courses/044268/w0809_website/recitations/Median.pdf

    I hope this helps.
    Hristo

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

Sidebar

Related Questions

So I have an extension which I can choose as a content element. It
If you can choose a platform to work with, when you build a new
I am in a position where I can choose the client browser for my
In the visual studio project settings you can choose a strong name key file
I have a page upon which a user can choose up to many different
I have a form in which the user can choose a component type from
I need to create a Word template where I can choose from different paragraphs
I'm developing a little portfolio where I can choose a category and when I
I need to generate a report where the user can choose All Issues, Open
I need to setup a system where customers can choose to Request a Quote

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.