•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 392,078 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,049 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser:
Views: 668 | Replies: 1
![]() |
•
•
Join Date: Nov 2006
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
I have to redesign a bookshop programme which allow user to make order of books.
This programme is originally using vector to implement.Now i have to decide either use deque or hash_map for the programme or i would better keep using vector??
In fact, I just know these three kinds of containers in STL.Are there any other choices in STL???
Thank you so much~
This programme is originally using vector to implement.Now i have to decide either use deque or hash_map for the programme or i would better keep using vector??
In fact, I just know these three kinds of containers in STL.Are there any other choices in STL???
Thank you so much~
•
•
Join Date: Aug 2005
Location: Plantation, FL
Posts: 14
Reputation:
Rep Power: 4
Solved Threads: 3
hash-map(or hash tables) are usually used for getting retrieval of records in O(n) time... something you'd see in a database design. vector is probably the quickest and simplest way to go:
- its dynamically re-sizable
- you can access any element in linear time.
as your customer orders book, its as simple as pushing back the the book onto your order vector.
my vote says staty with the vector. but if you dont/ cant use a vector, theres always a linked list (doubly linked list) too.
- its dynamically re-sizable
- you can access any element in linear time.
as your customer orders book, its as simple as pushing back the the book onto your order vector.
my vote says staty with the vector. but if you dont/ cant use a vector, theres always a linked list (doubly linked list) too.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
Similar Threads
- Phonebook program! (C)
- Memory control with a vector (C)
- Can someone please help me with Binary Addtion. (C++)
- need some help please (C++)
- STL set vs. map (C++)
- Fast data storage (C++)
Other Threads in the C++ Forum
- Previous Thread: How to generate Graphics in Dev c++
- Next Thread: What does *&p do?


Linear Mode