Ohio phonebook has gotten mixed up

Assignment Help C/C++ Programming
Reference no: EM13168181

In an accident, the Ohio phonebook has gotten mixed up. The names are now really out of order. You and your enthusiastic, but naive, assistant Carl must fix the problem. No one can use the phonebook while you are sorting it, so every extra second of sorting time will cost the city billions in economic damage.

Carl has implemented two programs, P1 and P2. Both will do the job correctly. You must decide which one will be faster.

1.Carl picks 20 random names and finds that P1 sorts them faster than P2. "We're using P1!" exclaims Carl. Why are you hesitant to commit?

 

2.Trying to please you, Carl is now sorting 10,000 names with each program. (a) If P1 is still faster on this larger set, will you then agree it will be faster on the whole million-name phonebook? (b) What if P2 is now faster - does that mean P2 is the best choice for the whole phone book? Explain.

 

3.Your computer explodes and Carl puts together a new one from spare parts. The new computer is much faster at arithmetic, but is slower at reading and writing to the disk. Might this affect which program you should use? Discuss.

 

4.In deciding which program to use, is it safer to run lots of tests or read the source code? Or should you do both? Explain. (Note: Carl's code is clear and well-commented.)

 

 

Reference no: EM13168181

Questions Cloud

Show the contents of the id array : Show the contents of the id array after each union operation when you use the quick find algorithm (Program below) to solve the connectivity problem for the sequence 0-2, 1-4, 2-5, 3-6, 0-4, 6-0, and 1-3.
Allows a user to select a favorite basketball team : Write an application that allows a user to select a favorite basketball team from a list box. Include at least five teams in the list, and display the chosen team in a text field after the user makes a selection. Save the file as JBasketball.java. :
Your company has assigned you the task : Your company has assigned you the task of evaluating its computer networks. You are to write a memo covering 15 points on which you will evaluate the technology, connectivity, and functioning of the company's computer networks
How to select the primary key : How to select the primary key from the candidate keys? How do foreign keys relate to candidate keys? provide examples from either your workplace or class assignments
Ohio phonebook has gotten mixed up : In an accident, the Ohio phonebook has gotten mixed up. The names are now really out of order. You and your enthusiastic, but naive, assistant Carl must fix the problem. No one can use the phonebook while you are sorting it, so every extra second of ..
A university library database records : A university library database records information about books; for each book, it records the book isbn number (which is unique), and the book name. In addition, it records which books have been checked out
Program that computes and prints the value of 6!/5! using : Write a Java program that computes and prints the  value of 6!/5! using Scanner.
The method takes an array : The method takes an array of integers and returns true if there exists any item in the array that satisfies a specified condition. For instance, the following code fragment:
Write a class volumeofbox that calculate the volume : write a class VolumeOfBox that calculate the volume by this formula : length * breadth *

Reviews

Write a Review

 

C/C++ Programming Questions & Answers

  Base process which communicate with child processes

Write a program which has a "base process" which communicates with child processes acting as "bombers" that it creates.

  Write a program that computes the cost of long distance call

Write a program that computes the cost of a long distance call. The cost of the call is determined according to the following rate schedules.

  Calculates the average of those numbers

Write a C program which takes n number of element from user (where, n is specified by user), stores data in an array and calculates the average of those numbers. Output of the program should look like this;

  Assessment system of a university

Write a program for Assessment system of a University

  Use the top-down modular approach to design program

Use the top-down modular approach and pseudocode to design a suitable program to solve it. Where appropriate, use defensive programming techniques.

  C++ program to draw a correct texas flag using rectangles

Write a C++ program to draw a correct Texas flag using rectangles, lines, and/or polygons (not images).

  Create a c++ console application

Objective: Create a C++ console application that will model the characteristics of a resistor. Create a multifile project. Create and add to the project an h file containing the resistor-class definition. Create and add to the project a cpp file cont..

  Use the convention that all years have 360 days

In writing the days() function, use the convention that all years have 360 days and each month consists of 30 days. The function should return the number of days for any Date structure passed to it. Write a main () function to test your function.

  Catch clauses are listed is important

write a program that can be used to demonstrate that the order in which catch clauses are listed is important

  Write a c++ program to choose two three-digit primes

Write a C++ program to choose two three-digit primes and an encryption exponent (3 or 17 may do nicely).

  Calculates the position of a cannonball

Write a c++ program that calculates the position of a cannonball that is fired straight up in the air. Use short time intervals (.01 seconds) and display the position and velocity every second.

  Program that displays the ball at a random

Write a C++ program that displays the ball at a random location and then makes the ball move down to the bottom of the screen. When the ball reaches the bottom of the screen, it should start these actions over again, appear-ing at another random l..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd