search vectors
-
Hi guys, I have two vectors of string and I'm looking for an easy way to find the first vector sequence or sub-sequence into the first one for example: Vect_1 < "JAVA", "ADA", "C", "C++", "C#"> Vect_2 < "C++", "C#"> search vect_2 sequence in vect_1 will return vect_1 position 3 and match length 2 Vect_1 < "JAVA", "ADA", "C", "C++", "C#"> Vect_2 < "JAVA", "C#"> search vect_2 sequence in vect_1 will return vect_1 position 0 and match length 1 thanks for any idea, suggestion
-
Hi guys, I have two vectors of string and I'm looking for an easy way to find the first vector sequence or sub-sequence into the first one for example: Vect_1 < "JAVA", "ADA", "C", "C++", "C#"> Vect_2 < "C++", "C#"> search vect_2 sequence in vect_1 will return vect_1 position 3 and match length 2 Vect_1 < "JAVA", "ADA", "C", "C++", "C#"> Vect_2 < "JAVA", "C#"> search vect_2 sequence in vect_1 will return vect_1 position 0 and match length 1 thanks for any idea, suggestion
Are you simply wanting to know how to search a
vector
?"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
Are you simply wanting to know how to search a
vector
?"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
it's a little bit more complicated I'm looking for a way to search a vector into an other vector std::set_intersection can do it, but in my case I have to respect the order of the sequence :doh:
kaminem wrote:
...search a vector into an other vector
What does this mean? :confused:
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
kaminem wrote:
...search a vector into an other vector
What does this mean? :confused:
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
I want to search vect_2 into Vect_1 for example Vect_1 < "JAVA", "ADA", "C", "C++", "C#"> Vect_2 < "C++", "C#"> here vect_1 contain all vect_2 elemnts and in the some order but if I don't find the entire sequence I should look for a subsequence too (and this is my big pb) I'm trying to avoid the use of for loop
-
kaminem wrote:
...search a vector into an other vector
What does this mean? :confused:
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons