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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:56:33+00:00 2026-06-14T19:56:33+00:00

I know the complexity is O(nlog(n)). But why? How do you come to this

  • 0

I know the complexity is O(nlog(n)). But why? How do you come to this answer?

Any help would be much appreciated, I’m very interested to know!

  • 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-06-14T19:56:34+00:00Added an answer on June 14, 2026 at 7:56 pm

    Its average case complexity is considered to be O(n log(n)), whereas in the worst case it takes O(n^2) (quadratic).

    Consider the following pseudo-code:

    QuickHull (S, l, r)
    
         if S={ }    then return ()
    else if S={l, r} then return (l, r)  // a single convex hull edge
    else
        z = index of a point that is furthest (max distance) from xy.
        Let A be the set containing points strictly right of (x, z)
        Let B be the set containing points strictly right of (z, y)
        return {QuickHull (A, x, z) U (z) U QuickHull (B, z, y)}
    

    The partition is determined by the line passing through two distinct extreme points: the rightmost lowest r and the leftmost highest points l. Finding the extremes require O(n) time.

    For the recursive function, it takes n steps to determine the extreme point z, but the cost of recursive calls depends on the sizes of set A and set B.

    Best case. Consider the best possible case, when each partition is almost balanced. Then we have

    T(n) = 2 T(n/2) + O(n).

    This is a familiar recurrence relation, whose solution is

    T(n) = O(n log(n)).

    This would occur with randomly distributed points.

    Worst case. The worst case occurs when each partition is an extremely unbalanced. In that case the recurrence relation is

    T(n) = T(n-1) + O(n) 
         = T(n-1) + cn
    

    Repeated expansion shows this is O(n^2). Therefore, in the worst case the QuickHull is quadratic.


    http://www.personal.kent.edu/~rmuhamma/Compgeometry/MyCG/ConvexHull/quickHull.htm

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

Sidebar

Related Questions

Know this might be rather basic, but I been trying to figure out how
I know that this sort of question has been asked here before, but still
i know this is a stupid question but i d'ont know how to do
I would like to know the complexity (as in O(...) ) of the following
I would like to know what the complexity of the following two operations are.
I would also like to know which algorithm has the worst case complexity of
I'm interested to know if there is any literature out there on the relationship
I know this question has asked before, but I'm still learning JavaScript, and I'm
I know this question has been asked and answered many times. But almost all
I would like to know whether this works in worst case as Θ(n+m) ?

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.