Ask your own question, for FREE!
Computer Science 32 Online
OpenStudy (anonymous):

You can use the "find()" function to find if a value exists inside of a vector as such: (find(vector.begin(), vector.end(), alueToBeFound) != vector.end()); My question is, how do you perform this search in a two-dimensional vector but only on one of the dimensions? For instance, if I had "vector< vector >" such that vector[i][j] existed how could I only search through the 'i' values and not the j's? I'm wanting to store page reference strings in one of the columns and a timestamp in the other. However, when searching for a value I only want to check the page references not the t

OpenStudy (konradzuse):

To solve for only 1 of the variables do a for loop. for(int k = 0; k < i; k++) { //do something vector[k][j] or change k's to i's. }

OpenStudy (anonymous):

This is what I ended up doing (already finished). However, after spending 5 hours finally getting all of my extremely inefficient code (so many loops..) to work, I realized I could have just created a class structure and been done in 20 minutes. FML.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
russianmafiya: Help me think of titles for any type of song
3 hours ago 0 Replies 0 Medals
Austinsbabygirl4life: Do mods know ppl address?
3 hours ago 4 Replies 1 Medal
Midnight97: Here's the new beat lmk what y'all think!!
6 hours ago 19 Replies 1 Medal
luhbabyliyahh: Do you realize that frozen was made 13 years ago?u00bf
7 hours ago 2 Replies 1 Medal
luhbabyliyahh: Do you realize that 2020 was 4 years ago??u00bf
7 hours ago 0 Replies 0 Medals
Stringcheese272: i made a song
8 hours ago 0 Replies 0 Medals
Stringcheese272: I made a song lmk wut yall think
8 hours ago 1 Reply 0 Medals
prettygirlzariah: Here is my prom dress
5 hours ago 12 Replies 5 Medals
jayfafr: i have a dilema
8 hours ago 0 Replies 0 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!