Reference no: EM131048316
Sorting and Running Time
Merge Sort
We're going to show that Merge Sort has an O(n lg n) running time by timing the code on the computer.
You need a running version of Merge Sort. Feel free to use the version with the videos or one that was done in class.
- cp ~kurban/public_html/permanent/cpp-examples/mergeSort/* . (for the video one)
- cp ~kurban/public_html/csc125/ (for the live class, the name may vary)
What to do
To time an individual run, create a linked list of some number (say 1,000,000) random elements, and run the code with and look at endTime - startTime. This is one datapoint.
Write a program that will:
- generate at least 200 different data points of various sizes.
- Those points will be written to a 'csv' file. Comma separated value files are text files that can be read into a spreadsheet directly.
- This code should run for HOURS
- You can run it on any machine you want
Overview of the program for loop (at least 200 times)
- Pick a number of items to sort, perhaps based on the outer loop and a random number, lets call it n
- for loop (n times)
? create random number and insert into linked list using ll.insert()
- end while
- start timer
- ll.mergesort()
- end timer
- append n and elapsed time to a data file
end for loop
Tree Parser
Write a c++ cgi script that will parse a program that's passed into it and act of the results. The program is a new, simple language it made up that works with a single queue.
Doodle Bugs Start
Look at the doodlebug problem in the text book:
- Page 888-9 from text. Ex 9 (9th ed)
- Page 863-4 Ex 11 (8th ed)
Rather than just use a console for the interface, lets build a web app that will do it. (Obviously there are better technologies for this!)
This web app just creates a world, it doesn't run the simulation. There's no eating or starving or breeding in this lab.
- I have put the interface together, your job is to add some new classes to the entire program:
- My code is at h ttp://www.csit.parkland.edu/~kurban/permanent/cpp-
e xamples/doodleStart/
on linux, use
cp ~kurban/public_html/permanent/cpp-examples/doodleStart/* .
pond object has a blue water-like image
- You will need to create the class and put in the proper virtual functions required by Organism
- You will need to add a public method to the World constructor called makePond() and call it from the constructor
- The makePond() method will be called from the world constructor after fillBorder() and will make a continuous pond.
- Either it can be rectangular. (Choose two rows and two columns and fill in between them)
- Or it can be round. (Choose a center and a diameter, and points where the distance from the center is < radius is a pond)
- It must be random, so a reset will draw a new one.
A frog object has a colorful frog image (so it can be seen)
- You will need to create the class and put in the proper functions required by Organism
- You will need to add a public method to the world constructor called
makeFrog() and call it from the constructor
- The makeFrog() method will be called from the world constructor after fillDoodleBug() and will make frog with a 1 in 100 probability on an empty square.
- a link to your code in the message area.
- an image of the webpage with a pond and crickets.
Message : My instructor requires use the softwares: CodeBlocks, Putty and Wincp.
Almost codes the instructors given in his files( or link) , you need to change or adjust parts of codes to finish those labs.
We use codeblocks coding and use Linux(putty) to run on my web link
Attachment:- Labs.rar
Observations per group does your analysis use
: Comparisons among means for one factor in a two-way analysis. We have illustrated Tukey pairwise comparisons among all treatment means in both one-way and two-way settings. The method can also compare the mean responses to just one of the two fact..
|
Why are congresss approval rating so low
: What is the point of congressional committees? why are some committiees more influtial then others?" "Why are congress's approval rating so low?"
|
Continue your analysis of the data from the previous
: Girls' cross-country times: a contrast (optional). Continue your analysis of the data from the previous problem by comparing average race time during the first half of the season with the average for the second half.
|
Describe the major provisions that most constitution contain
: Describe the major provisions that most constitutions contain. Response should in part or all be taken from this textbook in use: Dye, T.R. & MacManus, S.A. (2012). Politics in states and communities (14th ed.).
|
Write a cgi script that will parse a program
: Show that Merge Sort has an O(n lg n) running time by timing the code on the computer - Overview of the program for loop
|
Using some of the seven criteria fraser identifies
: Using SOME of the seven criteria Fraser identifies, explain why the model you have chosen is preferable to the other two. How well will your model meet the needs of low-income families and single mothers?
|
Herbicide and corn hybrids
: Herbicide and corn hybrids. Genetic engineering has produced new corn hybrids that resist the effects of herbicides. This allows more effective control of weeds, because herbicides don't damage the corn.
|
Number of times each of three types of behavior
: Hooded rats: object play counts. The researchers who conducted the study in the previous exercise also recorded the number of times each of three types of behavior (object play, locomotor play, and social play) occurred.
|
Stepped up and down for three minutes
: Exercise and heart rate. A student project measured the increase in the heart rates of fellow students when they stepped up and down for three minutes to the beat of a metronome.
|