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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:51:34+00:00 2026-05-13T11:51:34+00:00

I have a scenario where I’m pushing change-lists to another system. Each list contains

  • 0

I have a scenario where I’m pushing change-lists to another system. Each list contains zero or more inserted, updated or deleted notifications.

Inserting is easy; the notification contains the target index and a pointer to the item. Updating is easy; I pass a pointer to the item.

Deleting seems straight-forward; I need to pass the index of the item to delete, but how do I know the index? Indexes start at zero and must be contiguous, but I make them up at insertion time. So I need to keep track of the index I make up for each item.

I can do this with, for example, a map: std::map<item*, int>, but then when I remove an item, I have to go re-number everything past it, which is O(N).

These lists of items are going to be large to the point where O(N) iteration is not acceptable. I’m sure this problem has been solved, I just don’t know what the solution would be called. Searching for anything related to “linked list” creates a ton of noise.

One possible solution is a skip-list, where each node in the sublists knows how many nodes in the main list it skips, and since searching a skip list is O(log N) we can keep track as we go and find the index in O(log N) and also delete items in O(log N).

However implementing a skip-list seems like overkill here… is there a simpler solution?

EDIT:

Thanks all for your suggestions, but I think I’ve convinced myself the skip list is the right way to solve this problem here.

  • 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-13T11:51:34+00:00Added an answer on May 13, 2026 at 11:51 am

    Skip List is the correct solution.

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

Sidebar

Related Questions

I have this scenario. An ascx contains this GridView: <asp:GridView ID=dataTable runat=server > <Columns>
We have a scenario where we want to display a list of items and
I have scenario where i need to transfer one or more file depending on
I have an scenario with objects moving around on a coordinate system. I thought
I have a scenario where I want to call one TFS build from another,
I have scenario, Page contains Check in date and Check out date for input.
I have a scenario where there is an apartment and each apartment has flats
I have scenario where I need to host a web service (WCF) on Azure
I have scenario, I have two update panels on the page (both have update
I have scenario where I have to use the same XSD element for different

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.