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

  Chess program, enable a monitoring component

Given a chess program, enable a monitoring component to switch planning algorithms at runtime, based on the opposing player's style and response time.

  Write a program using for loops t

Write a program using for loops to produce the following output. Please read carefully the entire specification!

  Write a menu-driven c program

Write a menu-driven C program with appropriate functions that allows the user to fill an array of 50 integers with random numbers on the range 1...999, inclusive, sort it, and then find search it to determine if a given random number was generated..

  Write a programme on credit card number check

Credit Card Number Check. The last digit of a credit card number is the check digit, which protects againsttranscription errors such as an error in a single digit or switching two digits

  Program to input the length of the side from the keyboard

write a program to input the length of the side from the keyboard ,use the class to obtain the areas of all shapes and display the results on the screen

  T computes and posters the probabilities of two people

Write a C program that computes and posters the probabilities of two people in a group who are born in the same day. The probability of two people being born in the same day of the year, for a group of  n people, is given by the following formula:

  Writing a program that creates a linked list

Writing a program that creates a linked list from 100 randomly generated numbers and sorts the using a heap. One heap in ascending order and one heap in descending order. Then displays the original linked list and both sorted lists.

  During the execution of the above code, how many instru

(a) During the execution of the above code, how many instructions are executed? (b) Assuming a standard unicycle machine (CPI = 1) running at 100 KHz, how long will the above code take to complete?

  Implemented a regular binary search tree

In Computer Science I, you implemented a regular binary search tree. Due to your busy schedule, you've decided that it would be best if you could simply reuse this code without any changes. You realize that your code would ONLY work for Arup's ass..

  Write c program for linked list applications

Write a complete C program which illustrates the Linked list applications data structures and algorithms. The program will read in mid-semester test scores as Main Linked List and produce six outputs:

  The mean and standard deviation

How do i write a program in c++ that use functions max, min, the total numbers, the mean and standard deviation to read a file text and return these values from the file text. note the file text has random numbers. note im not suppose to use arrays.

  Compares the number of possible sequences

A c++ program that compares the number of possible sequences of the length L that can be generated uinder the following assumptions. Given an alphabet of size N=9. The program must output a formatted list comparing the number of possible sequences..

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