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

  Converts the temperature f in farenheit to c in celsius

Write a program that converts the temperature F in Farenheit to C in Celsius using C = (F-32)*5/9. For ease of programming you can display the result in fractions.

  Three dimensional array representing parking spaces

start with code in the file lab.cpp. This program works with a three dimensional array representing parking spaces in a parking garage on several floors. The code is incomplete. The functions "main", "display" and "showSpace" are complete. Your job i..

  Enter the temperature at noon of each of the five days

Write a program that allows each employee to enter the temperature at noon of each of the five days and displays the highest, lowest, and average (mean) temps.

  Write a program that fills in an array

Write a program that fills in an array, a, of 25 integers where each element contains the sum of all the previous elements plus 1, e.g., a[0] is 1 and a[3] is equal to a[0] + a[1] + a[2] + 1.

  Two for loops that will calculate the sum of all even number

Write a program using two for loops that will calculate the sum of all even numbers between 2 and 100,

  Need a program that has the user enter a string

Need a program that has the user enter a string. The program will test to see if its a exact palindrome like "civic" or "level". then it should test if its an inexact palindrome like "a nut for a jar of tuna".

  Find the sixth maclaurin polynomial for sin x

Find the sixth Maclaurin polynomial for sin x and use Chebyshev economization to obtain a lesser-degree polynomial approximation.

  Create the appropriate constructor, getters and setters

Create the appropriate constructor, getters and setters for the class. Create an instance of Student for each of the students listed above from array. Construct the instance with lastname, firstname, and job.

  Linked list in c++

If the following C++ code is valid, show the output. If it is invalid, explain why.

  Pointer variables to demonstrate shallow and deep copy

Using C++, write a program that uses pointer variables to demonstrate shallow and deep copy. The program should give the user the choice to do the following:

  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).

  Emulates the behavior of a bus

Write a program that emulates the behavior of a bus. The bus must have a schedule ( a finite number of times for it to stop) and a certain capacity (number of passengers). In this program the bus has two states: stopped and going.

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