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

  • Home
  • SEARCH
  • 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 3601844
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:40:18+00:00 2026-05-18T20:40:18+00:00

For a project at university, we had to implement a few different algorithms to

  • 0

For a project at university, we had to implement a few different algorithms to calculate the equivalenceclasses when given a set of elements and a collection of relations between said elements.

We were instructed to implement, among others, the Union-Find algorithm and its optimizations (Union by Depth, Size). By accident (doing something I thought was necessary for the correctness of the algorithm) I discovered another way to optimize the algorithm.

It isn’t as fast as Union By Depth, but close. I couldn’t for the life of me figure out why it was as fast as it was, so I consulted one of the teaching assistants who couldn’t figure it out either.

The project was in java and the datastructures I used were based on simple arrays of Integers (the object, not the int)
Later, at the project’s evaluation, I was told that it probably had something to do with ‘Java caching’, but I can’t find anything online about how caching would effect this.

What would be the best way, without calculating the complexity of the algorithm, to prove or disprove that my optimization is this fast because of java’s way of doing stuff? Implementing it in another, (lower level?) language? But who’s to say that language won’t do the same thing?

I hope I made myself clear,

thanks

  • 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-18T20:40:19+00:00Added an answer on May 18, 2026 at 8:40 pm

    The only way is to prove the worst-case (average case, etc) complexity of the algorithm.

    Because if you don’t, it might just be a consequence of a combination of

    • The particular data
    • The size of the data
    • Some aspect of the hardware
    • Some aspect of the language implementation
    • etc.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For a university project I programmed a Internet Explorer Browser Helper Object to process
While I was working on an University project, I used a project-internal profiler made
I am creating a php/mysql application for a university project and I am looking
I and two others are working on a project at the university. In the
For a university mid-term project I have to design a configurable processor, to write
I'm doing a project in a course at my university on distributed systems. I'm
Project Darkstar was the topic of the monthly JavaSIG meeting down at the Google
Every project invariably needs some type of reporting functionality. From a foreach loop in
A project I'm working on at the moment involves refactoring a C# Com Object
My project is based on spring framework 2.5.4. And I try to add aspects

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.