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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:16:49+00:00 2026-05-14T20:16:49+00:00

I figured out an algorithm that lets me turn my holed polygons into trapezoids

  • 0

I figured out an algorithm that lets me turn my holed polygons into trapezoids in linear time if I have vertex indices sorted from lowest coordinate to highest.

I get simple polygons as contours. They have certain order that might be exploited most of the time.

So giving these conditions, is there a near-linear-time algorithm on sorting?

  • 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-14T20:16:49+00:00Added an answer on May 14, 2026 at 8:16 pm

    I think the answer you want is “no”, but I also think you might want to consider your question more carefully.

    The problem is that you are using continuous coordinates, so in principle you can’t use a linear sort. (In practice, you can use use, say, a radix sort to handle a fixed-size coordinate, but in practice this may actually be slower than a standard O(N log N) sort, due to the overhead involved…)

    The theoretical rule is: whenever you have a situation where you can only compare your values, a general sort cannot be faster than O(N log N).

    You mentioned an unspecified property that “might be exploited most of the time”. The problem is that O() notation is an asymptotic, worst-case, theoretical property, so “most of the time” won’t make a difference. A specific property of the input can often be exploited in this way, but:

    • the O() speedup is very sensitive to exactly what your property is
    • an algorithm with a better O() might be much slower for your practical application
    • the most effective technique to practically exploit your input is often very different from the technique with the best asymptotic properties

    Unfortunately, when tweaking your algorithm to exploit your input, it is easy to miss an obscure worst-case scenario which will kill your performance in unexpected ways, long after you have released it. The most important thing about the O() of your algorithm is to stop it from blowing up badly like this.

    Note that, for this purpose, O(N log N) is near-linear, and using a standard, well-behaved library sort may well be the right choice.

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

Sidebar

Related Questions

I have to implement simple ray tracing algorithm, but I can not figure out
I figured out that a constant literal get's placed in the data segment of
I figured out that CUDA does not work in 64bit mode on my mac
I figured out that of course . and SPACE aren't allowed. Are there other
I'm working on Project Euler #14 in C and have figured out the basic
Lets say we have a bunch of numbers that increment in small values from
i have an algorithm that generates permutations of a given word. I'm trying to
Lets say you have website that keeps balance for each user. You give each
I have to figure out an algorithm, which finds a solution for the Connect
I have a piece of code that looks like this: Algorithm a = null;

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.