Question: ( 1 0 points ) Before you work on this problem, go to the C + + Resources page and read the two files: Arrays
points
Before you work on this problem, go to the Resources page and read the two files:
Arrays vs Vectors in Cdocx
Reminders on reading from a data file.docx
Consider the following problem. You have an array A A An of distinct integers that
has the following property: The values in the array increase up to index p for some
and then decrease for all indices beyond through position You want to find the index at
which the peak value occurs and what the peak value is
Example: In the element array illustrated below, the p index is and the peak value is
Describe write an English paragraph, not code a divideandconquer algorithm that can solve this
problem. Hint: the solution is a bit like the binary search algorithm. Do a formal analysis for
which you can assume that is a power of this means formulate and solve a recurrence relation
to prove that your algorithm does work units, where the work unit is comparison of array
values. Turn your algorithm description and analysis in on Canvas as a pdf file for the TA
Implement your algorithm in a C program called peak.cpp Recall your program will be run on
Visual Studio and you need to test it there before turning it in If you use Visual Studio to
create your program, be sure that you choose Empty Project. I expect that, on all coding
assignments, you will follow good coding practice reasonable identifier names, modularization
using functions, clear comments, etc.
Read the input values ie the array values as a series of integers, one per line, from a text file
called peak.txt make up your own file for testing your program. You can assume a maximum
array size of Or you can implement using a vector instead of an array.
Turn in only peak.cpp not all your project files or data files via Canvas Assignments.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
