Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

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

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M91772743
  • Price:- $180

Guranteed 48 Hours Delivery, In Price:- $180

Have any Question?


Related Questions in C/C++

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As