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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:40:20+00:00 2026-06-12T15:40:20+00:00

So, to clarify the question: Set A and Set B every element in set

  • 0

So, to clarify the question:

Set A and Set B
every element in set A has a partner in set B
you can not sort either set based upon comparing it to members of the same set, ie, each b element of B is indistinguishable from any other b of set B (likewise for A).
when Ai is matched with Bi you can tell if Bi > Ai, Bi < Ai or Bi = Ai.
design an algorithm with O(nlogn) running time.

The obvious answer with quadratic time is trivial and not helpful — although it’s the best I’ve come up with yet. The log(n) makes me think that I should be using recursion or a binary tree of some sort, but I’m not sure how could create a binary tree without being able to compare elements from the same set. Also, I’m not sure how to use a recursive call to any greater effect than just running nested for loops. Any tips would be greatly appreciated.

  • 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-12T15:40:21+00:00Added an answer on June 12, 2026 at 3:40 pm

    You haven’t stated it very clearly, but your question looks suspiciously like the Matching Nuts and Bolts problem.

    The idea there is to pick a random nut a, find the matching bolt b. Partition the bolts using nut a, and partition the nuts using Bolt b, and then recurse, like quicksort does.

    (Of course, we are talking about the average case being nlogn, rather than the worst case).

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

Sidebar

Related Questions

Lets clarify my question, I want to make an element which the element contains
I'm not sure really how to ask that question.. hopefully my explanation will clarify:
Just a short question, to clarify some doubts. Are setters not run when an
Apologies if this is a slightly noob question, but looking to clarify my thoughts
To clarify before I begin, this is NOT homework but rather I am studying
If a given web server can only read cookies from those set within its
Edit: I've changed my question and code to clarify my question better I've got
To better clarify my generic question: I have gotten the Android emulator to work
Can anyone tell me whether this class is threadsafe or not ? class Foo
Before I get to the actual question I would like to clarify some things

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.