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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:01:55+00:00 2026-05-26T08:01:55+00:00

Is there somewhere I can find out the expected time and space complexities of

  • 0

Is there somewhere I can find out the expected time and space complexities of operations on collections like HashSet, TreeSet, List and so on?

Is one just expected to know these from the properties of the abstract-data-types themselves?

I know of Performance characteristics for Scala collections, but this only mentions some very basic operations. Perhaps the rest of the operations for these collections are built purely from a small base-set, but then, it seems I am just expected to know that they have implemented them in this way?

  • 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-26T08:01:56+00:00Added an answer on May 26, 2026 at 8:01 am

    Performance characteristics of the other methods is really difficult to assert. Consider the following:

    • These methods are all implemented based on foreach or iterator, and at usually very high levels in the hierachy. Vector‘s map is implemented on collection.TraversableLike, for example.
      To add insult to injury, which method implementation is used depends on the linearization of the class inheritance. This also applies to any method called as a helper. It has happened before that changes here caused unforeseen performance problems.
      Since foreach and iterator are both O(n), any improved performance depends on specialization at other methods, such as size and slice.
    • For many of them, there’s further dependency on the performance characteristics of the builder that was provided, which depends on the call site instead of the definition site.

    So the result is that the place where the method is defined — and documented — does not have near enough information to state its performance characteristics, and may depend not only on how other methods are implemented by the inheriting collection, but even by the performance characteristics of an object, Builder, obtained from CanBuildFrom, that is passed at the call site.

    At best, any such documentation would be described in terms of other methods. Which doesn’t mean it isn’t worthwhile, but it isn’t easily done — and hard tasks on open source projects depend on volunteers, who usually work at what they like, not what is needed.

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

Sidebar

Related Questions

Is there a list somewhere on common Attributes which are used in objects like
Is there a list somewhere? I spent a lot of time yesterday trying to
I feel like this question is basic enough to be out there somewhere, but
I'm using .net. Is there some code somewhere that can change $11,456.50 -> eleven
Is there a log4net version built against Silverlight somewhere? Failing that, can someone suggest
Is there a list of COM error codes somewhere? Related: HRESULT: 0x80010105 (RPC_E_SERVERFAULT) question
Does anyone know how (if possible) I can find out how much capacity (mAh)
I was wondering if you know somewhere where I can find information on how
I know this is probably on the Internet somewhere but I can't find the
Is there a way I can access (for printout) a list of sub +

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.