473,411 Members | 1,937 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

What are the advantages of using STL vectors over STL deque?

What are the advantages of using STL vectors over STL deque?
Oct 5 '10 #1
3 2524
hype261
207 100+
This web site has some information on the differences between a vector and deque.

http://www.cplusplus.com/reference/stl/deque/
Oct 5 '10 #2
Thanks for the prompt reply. I have already gone through the above link.
However was not able to get any advantage of using vectors over dequeue. So was wondering what could be situation where vectors can be more efficient than dequeue?
Oct 5 '10 #3
newb16
687 512MB
the relevant part from the linked page is :
On the drawback side, unlike vectors, deques are not guaranteed to have all its elements in contiguous storage locations, eliminating thus the possibility of safe access through pointer arithmetics.
Oct 5 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

32
by: Protoman | last post by:
I have a function that calculates the mean of the some numbers; I need it to accept any number of parameters (one needs to be the number of the other parameters) Can you help me out here? Here's...
4
by: Protoman | last post by:
I have a function that calculates the mean of the some numbers; I want it to calculate the vector size at runtime. Can you help me out here? Here's the function: const long double& mean(long...
10
by: edward_nig | last post by:
Hi all, Please I tried to copy from a text file line by line and to paste the text in reverse order in another text file also line by line-Making the first line the last and the last line the...
2
by: ucfcpegirl06 | last post by:
Hello, I have a file that I am reading date from. File format is as follows: a 556644f3 b 44545351 ......
3
Digital Don
by: Digital Don | last post by:
I have a problem sending the Vectors as Referencial parameters..i.e. I am having a struct vector struct board { int r; int c; };
5
by: andrewmorrey | last post by:
Hello, I've got a VC++ project containing multiple classes and a main function. In one of the class functions, it reads from a text file and places the data into a vector; //...
10
by: pra1983 | last post by:
Can any one tell me how to use vectors insteard of two dimensional arrays... I was trying to store some thousands of values in an aray but i gives me error in between saying that " Stack is out...
3
by: mersinli | last post by:
Hello; I will use standard library vectors and implement simple map coloring algorithm. The goal of a map coloring problem is to color a map so that regions sharing a common border have...
14
by: Mohamed Mansour | last post by:
Hey there, this will be somewhat a long post, but any response is appreciated! I have done many PInvoke in the past from C++ to C#, but I did PInvoke within C# not C++/CLI. Can someone explain...
1
by: sharat | last post by:
hello groups. i am using fc4, gcc compiler. I am usngi vectors in my program and i m facing memory corruption problem it is giving error as " ** glibc detected *** double free or corruption...
0
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
0
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...
0
marktang
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
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...
0
agi2029
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.