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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started