Any suggestions
which stl data structure to use if
--i need to lookup names indexed by integer idnumbers assigned
contiguously from 0 to 10000.
--if the names were indexed by SSN#?
does hashtable fit here, indexed from 1 to 10000, but before storing
into a hash table, i should order them, and then can perform binary
search on it. i guess this is most efficient or is there any other
way.
for indexed by SSn#, can have a hash().
Thanks for any help:) 4 1351
c++novice wrote: Any suggestions which stl data structure to use if --i need to lookup names indexed by integer idnumbers assigned contiguously from 0 to 10000.
std::deque <value_type>;
--if the names were indexed by SSN#?
By whom, sorry?
does hashtable fit here, indexed from 1 to 10000, but before storing into a hash table, i should order them, and then can perform binary search on it.
Any ordering would be destroyed anyway.
i guess this is most efficient or is there any other way.
?
for indexed by SSn#, can have a hash().
??
--
Regards,
Buster.
c++novice wrote: Any suggestions which stl data structure to use if --i need to lookup names indexed by integer idnumbers assigned contiguously from 0 to 10000.
std::deque <value_type>;
--if the names were indexed by SSN#?
By whom, sorry?
does hashtable fit here, indexed from 1 to 10000, but before storing into a hash table, i should order them, and then can perform binary search on it.
Any ordering would be destroyed anyway.
i guess this is most efficient or is there any other way.
?
for indexed by SSn#, can have a hash().
??
--
Regards,
Buster.
"c++novice" <be**************@yahoo.com> wrote in message
news:34**************************@posting.google.c om... Any suggestions which stl data structure to use if --i need to lookup names indexed by integer idnumbers assigned contiguously from 0 to 10000.
a vector
--if the names were indexed by SSN#?
a map does hashtable fit here, indexed from 1 to 10000,
not really, the key word is 'contiguously', you can't get more efficient
than a vector size 10000.
[snip] for indexed by SSn#, can have a hash().
hash would work, except its not yet an official STL data structure.
john
"c++novice" <be**************@yahoo.com> wrote in message
news:34**************************@posting.google.c om... Any suggestions which stl data structure to use if --i need to lookup names indexed by integer idnumbers assigned contiguously from 0 to 10000.
a vector
--if the names were indexed by SSN#?
a map does hashtable fit here, indexed from 1 to 10000,
not really, the key word is 'contiguously', you can't get more efficient
than a vector size 10000.
[snip] for indexed by SSn#, can have a hash().
hash would work, except its not yet an official STL data structure.
john This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: LG |
last post by:
Just have a question with regards to the clipboard, and how to read what
other applications (Adobe InDesignCS) place in the clipboard.
I am currently in the process of creating a booklet from a...
|
by: kazack |
last post by:
Hi all it's me again with another question as I got further in my book. The
chapter I am in covers structres, abstract data and classes. I only read
through to the end of the coverage on...
|
by: Dave H |
last post by:
Hello,
I have a query regarding definition lists. Is it good practice
semantically to use the dt and dd elements to mark up questions and
answers in a frequently asked questions list, or FAQ?
...
|
by: Sean W. Quinn |
last post by:
Hey folks,
I have a question regarding file handling, and the preservation of class
structure. I have a class (and I will post snippets of code later in the
post) with both primitive data...
|
by: Steve Jorgensen |
last post by:
In a recent thread, RKC (correctly, I believe), took issue with my use of
multiple parameters in a Property Let procedure to pass dimensional
arguments on the basis that, although it works, it's...
|
by: Alfonso Morra |
last post by:
Hi,
I am having some probs with copying memory blocks around (part of a
messaging library) and I would like some confirmation to make sure that
I'm going about things the right way.
I have...
|
by: Mr Newbie |
last post by:
I am often in the situation where I want to act on the result of a function,
but a simple boolean is not enough. For example, I may have a function
called
isAuthorised ( User, Action ) as ?????...
|
by: Steve Barnett |
last post by:
I have a database with two tables "Structure" and "Data". The Data table
contains the data for my application, so no problem there. The Structure
table effectively puts some organisation to the...
|
by: karan.shashi |
last post by:
Hey all,
I was asked this question in an interview recently:
Suppose you have the method signature
bool MyPairSum(int array, int sum)
the array has all unique values (no repeats), your...
|
by: Herbert Kleebauer |
last post by:
As part of a simple X demo for Linux I send the byte string
in "send8" to the X server. This byte string displays a circle
at the x/y position send8.s8x/send8.s8y. In "display()" a 8x8
grid of...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |