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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:49:04+00:00 2026-06-03T01:49:04+00:00

I have read tons of articles on choosing the correct collection for a specific

  • 0

I have read tons of articles on choosing the correct collection for a specific implementation,
and I understand that in the end it will come down to benchmarking real data, but while I’m busy doing that:

  • What sorted collection in c# allows the modification of an item
    contained?I can’t seem to find any?

  • Is this because a modify would probably be implemented as a removal
    then re-insertion, thus making an explicit ‘Modify’ function
    pointless?

I am in need of a collection (custom or standard library),
with the following operations performed on it.

  • Insert – often
  • Remove – often
  • Modify – very often
  • Select Top X elements – every time any of the above happens, and more, concurrently.

Currently I am using a SortedSet, as it provides O(logn) inserts,but I am unclear on
removal performance and how to best modify an item.

  • 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-03T01:49:06+00:00Added an answer on June 3, 2026 at 1:49 am

    First, we need to clarify the meaning of modifying a collection.

    Generally, manipulating collection refers to insert/delete items from the list.
    To modify an individual item, it’s basically accessing the item and modify its properties. Cost of accessing an item depends on the collection implementation, but modification of item propertis is not dependant on the collection.
    Also note, you cannot modify a collection item if it’s not mutable.

    If you are just looking to find the best built-in collections, you are basically choosing between SortedList and SortedSet (SortedDictionary is the same as SortedSet).

    SortedList stores data internally as array, so it has efficient access by index (for getting top X items); SortedSet has faster insertion and removal (by constant factor), indexed access however will require searching through the tree for next item which in worst case is O(log n) and best caes O(1).

    Aside from that, difference between the two is quite small, as they both implements Red Black Tree, just differs in implementation details.

    Actual performance will have to be measured for your user cases. But you already know that.

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

Sidebar

Related Questions

I've read through tons of posts and articles and haven't found a fix that
I have read TONS of tutorials, articles and whatever regarding my issue and honestly,
I know that there are tons of similar questions because I have read them
I have read few articles about table partioning but still I am bit confused
I have read that GLSL (specifically v1.0.17: my application is running under WebGL) compilers
I have read tutorials and several stack overflow posts that suggest I should use
I have read the android spill on this method tons of times and it
I have read that some of the JVMs out there can optimize code execution
I must have read tons of solutions online, but for some idiotic reason I
I have read so many places is that if your code is not test-able

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.