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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:02:50+00:00 2026-06-03T21:02:50+00:00

I would like to implement a tool that generates graphs whose memory will be

  • 0

I would like to implement a tool that generates graphs whose memory will be allocated on a data structure so called “Tape”. You can think of a Tape as an array of elements, each of which holds “Node ID”, links to its “Parent Node” as well as its “Child Nodes”.

What I am looking for is an approach in which identifying available slots in the array is cheap so that when a new node is to be added, an empty slot can be quickly identified.

And what if I implemented the Tape using a dynamic array? In the situation where the size of the array needs resizing, can I avoid copying the entire Tape over to a newly allocated array?

Anyone here has any idea ?

  • 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-03T21:02:51+00:00Added an answer on June 3, 2026 at 9:02 pm

    I assume that you want to allocate a big ‘Tape’ beforehand of e.g. thousands of nodes.

    You should combine 2 concepts:

    • First store the last used entry on your tape. The next time a new entry is needed, just pick the one just after the last used one.
    • Second keep a free list. Use the first 4 bytes (or 8 bytes in 64-bit) of your tape entry as a pointer to the next free entry. The beginning of the tape should point to the first free entry.

    Whenever a entry on the Tape is freed, add it to the free list.

    Whenever a new entry is needed in the tape:

    • check whether there are elements in the free list. if there are take the first entry and remove it from the free list
    • if the free list is empty, use the last used entry and take the one immediately after it.

    You can also combine this with a reallocation scheme, where you keep the total allocate size of your tape and reallocate if the last used entry reaches the end of the tape.

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

Sidebar

Related Questions

I would like to implement a simple drawing tool that could run across most
I would like to implement a data access object pattern in C++, but preferably
I would like to implement a producer/consumer scenario that obeys interfaces that are roughly:
I would like to implement a post build event that performs the following actions
We would like to implement a web form that automatically saves content at regular
I would like to implement/use-existing a cross platform configuration settings tool like about:config in
I would like a plain forward DTO generation tool that would either Generate it
I would like to implement in python something like this: def producer(): while True:
i would like to implement a good throttle algorithm by in .net (C# or
I would like to implement something similar to a c# delegate method in PHP.

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.