Top "Vector" questions

A vector is a single-dimensional array: it contains components that can be accessed using an integral index.

Initializing a two dimensional std::vector

So, I have the following: std::vector< std::vector <int> > fog; and I am initializing it …

c++ vector
Sorting a vector in descending order

Should I use std::sort(numbers.begin(), numbers.end(), std::greater<int>()); or std::sort(numbers.rbegin(), numbers.…

c++ sorting stl vector iterator
How to access the contents of a vector from a pointer to the vector in C++?

I have a pointer to a vector. Now, how can I read the contents of the vector through pointer?

c++ pointers vector
What is the best way to concatenate two vectors?

I'm using multitreading and want to merge the results. For example: std::vector<int> A; std::vector<…

c++ vector
Why is Java Vector (and Stack) class considered obsolete or deprecated?

Why is Java Vector considered a legacy class, obsolete or deprecated? Isn't its use valid when working with concurrency? And …

java vector stack deprecated obsolete
Adding to a vector of pair

I have a vector of pair like such: vector<pair<string,double>> revenue; I want to …

c++ vector std-pair
How do I calculate the normal vector of a line segment?

Suppose I have a line segment going from (x1,y1) to (x2,y2). How do I calculate the normal vector …

math geometry vector
List distinct values in a vector in R

How can I list the distinct values in a vector where the values are replicative? I mean, similarly to the …

r vector distinct-values r-faq
How to create a numeric vector of zero length in R

I wonder, how can I create a numeric zero-length vector in R?

r vector numeric zero
Fastest way to find second (third...) highest/lowest value in vector or column

R offers max and min, but I do not see a really fast way to find another value in the …

r vector