Question: I need help with this coding assignment Searches.h #pragma once #include template int linearSearch(std::vector data, T target){ } template int binarySearch(std::vector data, T target){ }

I need help with this coding assignment

I need help with this coding assignment Searches.h #pragma once #include template

Searches.h

#pragma once

#include

template int linearSearch(std::vector data, T target){ }

template int binarySearch(std::vector data, T target){ }

Sorts.h

#pragma once

#include

template std::vector mergeSort(std::vector lst){ }

template std::vector quickSort(std::vector lst){ }

*On a side note, yes you are allowed to use helper functions however they are not required

DESCRIPTION For this lab you will implement two searches and two sorts Searches - The searches will take a data vector and an element to find, and return the index of the element in the vector, and -1 if the item is not found in the vector. Searches must work for integer, double, char, and string. Whether this is accomplished through templating or overloading is up to you. Must be named linearSearch and binarySearch. Linear Search Binary Search . Sorts - The sorts will take a data vector and return a sorted copy of the vector. Sorts must also work for integer, double, char, and string as with the searches. Must be named mergeSort and quickSort. Quicksort Merge Sort You may include additional helper functions, if you wish. Submit Searches.h and Sorts.h with the implemented functions. DESCRIPTION For this lab you will implement two searches and two sorts Searches - The searches will take a data vector and an element to find, and return the index of the element in the vector, and -1 if the item is not found in the vector. Searches must work for integer, double, char, and string. Whether this is accomplished through templating or overloading is up to you. Must be named linearSearch and binarySearch. Linear Search Binary Search . Sorts - The sorts will take a data vector and return a sorted copy of the vector. Sorts must also work for integer, double, char, and string as with the searches. Must be named mergeSort and quickSort. Quicksort Merge Sort You may include additional helper functions, if you wish. Submit Searches.h and Sorts.h with the implemented functions

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!