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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:28:47+00:00 2026-05-11T17:28:47+00:00

I have a function that receives three different people objects and generates a new

  • 0

I have a function that receives three different “people” objects and generates a new “compatibility” object based on the combined values in the “people” objects.

However, about 1/3 of the time the three “people” objects that it receives as input are the same as one before, though possibly in a different order. In these cases I do NOT want to make a new “score” object, but simply return a value contained within the existing object.

Originally, the program just loops through the list<> of “compatibility” objects searching for the one that belongs to these three “people” (since each “compatibility” object contains an array of people objects). This method is really slow considering that there’s over thousands of “compatibility” objects and over a million “people” objects.

I had the idea of using a dictionary where the key is a number I generated by combining the three people objects’ id values into a single UInt64 using XOR, and storing the score objects in as dictionary values rather than in a list. This cuts down the time by about half, and is acceptable in terms of time performance, but there’s way too many collisions, and it returns a wrong score too often.

Any suggestions or pointers would be much appreciated.

Edit: To add to the original question, each “people” object has a bunch of other fields that I could use, but the problem is making a key that is UNIQUE and COMMUTATIVE.

  • 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-11T17:28:47+00:00Added an answer on May 11, 2026 at 5:28 pm

    I think you’re looking at things in a much too complex manner. Take the 3 PersonID values and sort them,so that they’re always in the same order, no matter which order they were passed in. Then set a value in a hashtable using the three PersonIDs as the key, separated with a hyphen or some other character that won’t occur in a PersonID value. Then later, check if there’s a value in the hashtable with that key.

    So if the three PersonIDs are 10, 5 and 22, the hash key could be something like “5-10-22”.

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

Sidebar

Ask A Question

Stats

  • Questions 100k
  • Answers 100k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The lock you use depends on your platform but will… May 11, 2026 at 7:57 pm
  • Editorial Team
    Editorial Team added an answer The observer pattern is so named because the objects attached… May 11, 2026 at 7:57 pm
  • Editorial Team
    Editorial Team added an answer select s.Student_ID, s.FirstName, s.LastName, c.Contact_ID, c.Address, c.ZipCode, p.PhoneNumber1, p.PhoneNumber2, p.PhoneNumber3… May 11, 2026 at 7:57 pm

Related Questions

My page deals with many Store objects, each of them has a field called
I have a project where a function receives four 8-bit characters and needs to
I have a list box control: <asp:ListBox runat=server id=lbox autoPostBack=true /> The code behind
The question, in brief: In MVC, how do you distinguish between a checkbox click
When reading data in chunks of say, 1024, how do I continue to read

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.