Question: Write a function template named sequential_search to determine if a vector v contains a particula value x. The function template has two parameters: vectorv, and

 Write a function template named "sequential_search" to determine if a vector

Write a function template named "sequential_search" to determine if a vector v contains a particula value x. The function template has two parameters: vectorv, and value x to search. The elements in the vector are not sorted. The function template returns the smallest index of the vector where x is in the vector (in case duplicate elements are stored in the vector), and -1 (negative 1) if x is not foun in the vector. Write your function template in the correct C++ syntax. (10 points). . What is the time complexity of your search function template in terms of the big-O notation? Briefly explain your answer. (5 points)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!