Question: For this lab you will implement two searches and two sorts Searches - The searches will take a data vector and an element to find,
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.
Here's the starter code for Sorts.h
#pragma once
#include
template
template
#pragma once
#include
template
template
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
