i have to write this as follow
but when i run my programm it shows lot of errors
so someone can tell me what is the problem and how to solve it
and how to do extra coding as asked me in below
so i m new in c++
see the attachment also
Goal
We have discussed two algorithms for computing the 2-d maxima of a set of points in the x-y plane. One is the brute force algorithm which runs in O(n2) time and the other is sweep line which runs in O(n log n) time. Your task is code the sweepline algorithms in C++, run the two algorithms on input of xy points of varying size, determine the actual CPU time used and compare the times obtained.
Files Provided
• 2DMaxima.dev
This is the Dev-Cpp project file. It has appropriate settings in the project options that are needed to access the cpu timing routines. Load the project in Dev-Cpp and open the "Project Option" dialog. You will see an entry "C:\WINDOWS\system32\ibmts.lib" in the "General" tab in "Linker Options" and "C:\WINDOWS\system32" in "Files/Directories" tab "Include Directories".
• 2dm.cpp
This is only C++ source file in the project. The source does not make use of any C++ classes. It is actually a C source file. It uses the "printf" routine for printing of data instead of cout. You can get information on "printf" on the web or in any good book on C or C++.
The file contains most of the code already written for the assignment. Here is what the code does:
1. Setup global variable and arrays which are used by various functions. This avoids the need to pass parameters around.
2. The main routine picks up the value of n from the command line.
3. The routine generates a random set of "n" xy data points by calling a random number generator.
4. The main routine starts the CPU timer and calls the brute force routine to compute the maximal set for the given xy data points. Upon return, the main routine stops the timer and gets the actual CPU time used in seconds and microseconds. These two are then printed.
5. The main routine repeats the same for the sweep line algorithm.
The body of the sweep line function is empty. Your task is to write the sweep line routine using the algorithm discussed in the lecture. The sweep line algorithm sorts the xy data and then uses a stack to determine the maximal set. The stack ADT is available from data structures. Use the array implementation of the stack. In case the internal array is too small, increase the maximum size. You will need to add code for some suitable O(n log n) sorting algorithm. We have discussed merge sort and quick sort in the data structures course.
• ibmtsinst.exe
This file contains the installer for the CPU timing routines. The files in the package are installed in the directory "C:\WINDOWS\System32". Please install these on your machine by double clicking on the .exe file. The two files needed by the project are "ibmts.h" and "ibmts.lib".
Tasks to perform
Once you have the sweep line function working properly, run the program for various values of n. Fill up the following table from your timing analysis:
N Brute Force Sweep Line Ratio:
brute/sweepline
seconds microseconds seconds microseconds
50
250
500
1000
2000
5000
10,000
25,000
50,000
What to turn in
Turn in your DevCpp project: the .dev file and all .cpp and .h files. We will build the .exe and run it to see if it works correctly. Write a one page report that has the table or runtimes filled out with the CPU times you have obtained.
To run at command prompt
C:\> 2DMaxima.exe [input Size]
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.