Question: Part1 8:19 cs.sfu.ca dependent, please only include libraries that are part of the C++ standard General Requirements Your solution should comply with the following general
Part1 8:19 cs.sfu.ca dependent, please only include libraries that are part of the C++ standard General Requirements Your solution should comply with the following general requirements. Your solution should not be OS dependent, please only include libraries that are part of the C++ standard Specifically, do not include the stdafx.h library since it is Windows specific, if you are using Visual Studio you should uncheck the box that asks if you want to use precompiled headers when you create your project; to remove this option after you've created a project go to Project Properties Configuration Properties-CIC++ Precompiled Headers and select Not Using Precompiled Headers in the appropriate place in the right pane; you should also change your main function to int maino If you are unable to complete a function write a stub for it that returns a default value (if the function has a return value) Make sure that your program compiles and runs before submitting it - we reserve the right to not mark submissions that do not compile, if you are unable to complete the assignment then you should complete what functions you can, write stubs for the remainder and submit a solution that correctly mplements part of the assignment Common Features All your sorting functions should meet the following requirements Functions should be template functions that take a template variable for the type to be sorted (see the template lab or the read function near the end of this document for examples) Each sorting function should return an integer equal to the number of barometer operations performed during the function execution; the barometer instruction is the instruction that is executed the greatest number of times; when you count barometer operations choose a single barometer operation for each sort algorithm, you are not intended to be counting the total number of operations performed by the algorithm The functions should all be written in a single.cpp file that contains your main method; you are not required to write any classes for this assignment assignment Part 1 Insertion Sort An example of how to call the functions is given at the end of the Write a template function called insertionsort that sorts its array parameter using the insertion sort algorithm. The function should have two parameters, an array of type T (where T is a template variable), and an integer that records the size of the array. The function should return an integer that equals the number of times its barometer operation is made during its execution. Part 2 Quicksort Write a template function called quicksort that sorts its array parameter using the auicksort alaorithm. The function should have two parameters, an array of
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
