Use selection sort to sort a[48] into increasing order

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

1) Put the given numbers into an array int A[48].

 

97   24   77   58   76   92   43   68   18   52   55   53  

33   39   22   73   49   47   17   27   45   67   20   21  

35   63   19   64   81   51   97   29   98   20   53   14  

94   24   29   86   46   65   58   65   27   65   39   56.

 

Use selection sort to sort A[48] into increasing order, and then print out the sorted list in four rows. There may be duplicates, but that's OK. (65 and 53 appear twice.) Duplicates will appear next to each other in the sorted list.

2) Program binary search. .

 

Your program should give a prompt to the user "Please enter the number to search for."

 

After doing the binary search, your program should print out either

 

* Your number is in position ____, which is a number between 0 and 47.

 

When there are duplicates, such as 65, or 53, the program will print out the position of one of them.

 

The TA will come by to test your program. He will give you 3 numbers:

 

*A number not in the list.

 

*A number such as 65 that appears more than once.

 

*A number that appears exactly once.

 

your code should print out

"*I'm sorry, your number was not in the list."

If it is not in the list

 

 

Reference no: EM13162937

Questions Cloud

Example of sexual harassment according to text''s definition : According to a Lou Harris poll, compared to workers in the recent past, the average American worker today. and  an example of sexual harassment according to the text's definition?
Compute the approximate molarity : Calculate the approximate molarity of this solution from the volume, percent composition, and density.
Determine the abundance of each isotpe : there are two natuarlly occuring isotopes of rubidum. (85)Rb has a mass of84.9118 amu. (87)Rb has a mass of 86.9092 amu. Determine the abundance of each isotpe.
Write computer program to implement this algorithm : Write computer program to implement this algorithm and demonstrate the results and what is the machine run time in second for sorting array A?
Use selection sort to sort a[48] into increasing order : Use selection sort to sort A[48] into increasing order, and then print out the sorted list in four rows. There may be duplicates, but that's OK. (65 and 53 appear twice.) Duplicates will appear next to each other in the sorted list.
Compute the molar mass of the monoprotic acid : dissolved in water and completely neutralized by the addition of 43.70 mL of 0.303 M NaOH. Calculate the molar mass of the acid, assuming it to be a monoprotic acid.
What type of social influence situation : In what type of social influence situation do we follow direct commands from others?  forming, storming, norming, and performing
Analyze and create unique solutions : The ability to analyze and create unique solutions designed to make decisive and immediate resolutions, which allows for timely completion of tasks
Explain what is the volume of the gas at stp conditions : What is the volume of the gas at STP conditions? b.) What is the molar volume of the gas?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  State diagram to recognize one form

Design a state diagram to recognize one form of the comments of the C-based programming languages, those that begin with /* and end with */. and also Write and test the code to implement the state diagram.

  Design a class named employeerecord

Design a class named EmployeeRecord that holds an employee's ID number, name, and payrate. Include mutator methods to set the values for each data field and output the values for each data field. Create the class diagram and write the code that

  Array of integers declared-initialized to number of tickets

Array of integers named parkingTickets has been declared and initialized to number of parking tickets given out by city police each day as beginning of current year.

  In c++, write a program that calculates 10,000 tries.

In C++, write a program that calculates 10,000 tries. These tries are based upon a rat trying to escape from a maze. Keep adding minutes until the rat is free and when he is free that is 1 try so we need 10,000. We start by randomly generating a numb..

  Basics of code development on linux and cryptography

Prepare a C program that gives simple mono-alphabetic substitution between plaintext, and Enhance your code to use "-e" to encrypt a string argument and "-d" to decrypt it using argv and argc

  Design a deck plan space ship in eclipse

Develop a simple interactive two-dimensional spaceship deck plan editor using OpenGL and GLUT. Your program will enable a user to create and save a deck plan of a hypothetical spaceship comprising the hull walls.

  Complete the payroll program with following driver object

complete the payroll program with the following driver objects.

  Design a nested program

How many levels of nesting are there in this design?

  Public transport fare ticketing system

Implement and test a public transport fare ticketing system.

  The funtion should take as parameters

Write a function in c ++ that multiplies two functions. the funtion should take as parameters two fraction structures. Then, the function should multiply the two fractions and return the solution as a fraction structure.

  Write a function that takes an integer array

1. Write a function that takes an integer array and the array's size as parameters. The function will check if the array is sorted. If it is, it will return a 1. If it is not sorted it will return 0. The function should not  sort the array.

  Computer programming using c language lab

Computer programming using c language lab

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