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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:27:31+00:00 2026-05-21T20:27:31+00:00

I am currently in the thinking process of the data structure I might use

  • 0

I am currently in the thinking process of the data structure I might use for a current project. I don’t need to delete items as i am loading a database,using it, and then exiting the program. The only constraint concerns search time.(memory in a second time but mainly time).

Overview on what I intend to do.
I am parsing files and extracting informations that I use to create various object.
After reading the files and creating the objects,i have a set of multiple objects that have references to other one as string.

The goal here is to find which net goes from one domain to another

E.g : text input file :

module Blabla 
netTomodule Foo
domain 1
..../*Other parameters of the module*/
end module

module Foo 
netTomodule Blabla
netTomodule Foo2
domain 2
..../*Other parameters of the module*/
end module

module Foo2
netTomodule Foo
domain 2
..../*Other parameters of the module*/
end module

After reading this I get 3 module objects Foo Foo2 and Blabla and their attributes are as follow :

class Module{
private :
string name;
int domain;
netlist * mynetlist;
...
}  

My opinion and the thing i want to get advice on :

After thinking about this, i think that my best shot is to :

  1. When reading the file and extracting info, i should create a linked list of Module.
  2. Then with the number of Module i have read, i create an array that is double the size of that.
  3. For each module, I use a hash function to hash the module name and put a pointer to this module at the given index in the array
  4. Now when i will want to find a module, i just have to compute the hash value and get the pointer at the given index(or increment if its not the good module because of a collision previously in the making of the array)

This is basically an implematation of a hashtable or atleast what i know of a hashtable from my clasess.

My question is Is this a good thought ? Is there a hashtable library i can use that does that ? (i have heard and look for unordered_map and map but i don’t know if it fits my needs very well)

This is a huge text so i hope it is detailed enough, so thank you if you have the courage to read everything !

  • 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-21T20:27:32+00:00Added an answer on May 21, 2026 at 8:27 pm

    Just use any hash table that comes with your standard library or from boost. Most will have the unordered_map (as specified by TR1 and proposed for C++0x) as does boost, but some will have a std::hash_map or stdext::hash_map with various implementation being slightly different, e.g. the original SGI vs. Microsoft.

    You don’t need to build a list, just put the objects directly in the hash table; it allows sequential iteration, though it will be in some fixed random order.

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

Sidebar

Related Questions

We are currently thinking of building a cache-system to hold data pulled out of
I am currently thinking about open-sourcing a project of mine and am in the
I'm currently working on a project in which i need to read some (Latitude,
Currently thinking about pitching the argument for us migration from vs 2005 (winforms) to
I'm trying to make a Tetris-like game in XNA, and currently I'm thinking of
We are currently using Mysql version 5.0 in our application and are thinking of
We're currentlly thinking about secureity in our applications. Our preferred method of getting data
Currently, I don't really have a good method of debugging JavaScript in Internet Explorer and
Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database.
Currently we have a project with a standard subversion repository layout of: ./trunk ./branches

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.