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

  The fibonacci sequence

In the novel "The DaVinci Code", a scrambled version 13, 3, 2, 21, 1, 1, 8, 5 of the first eight Fibonacci numbers appear as one of the clues left by murdered museum curator Jacques Sauniere. In this assignment, we will do something related to t..

  Two types of sporting teams

Select two types of sporting teams and de?ne subclasses for them. These classes shouldinherit from a base team class such as that created in Exercise 1. Include uniquecharacteristics about the sport.

  Multiple choice question on c programming

Create a function to print "88 is a great port number" function name is yourName_PrintFunction no input no return type print "88 is a great port number"

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  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.

  Make a game in which you guess a number

Make a game in which you guess a number between two set numbers to find the answer, the game should tell you if you are too low in your guess or too high. For example

  Implement the guess the word

Implement  the ‘Guess the Word' game in an object-oriented manner

  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.

  Program to compute surface area of sphere using function

Write down a program in C++ to compute surface area of sphere using a function. As sample run, write down the surface areas of spheres with radii.

  Consists of an employee''s last name

Each input line consists of an employee's last name, first name, current base salary, total sales and percent commission. For example, in the first input line, the last name of the employee is Thomas, the first name is Andrew, the current base salary..

  Write a c program that asks for and reads in two integers

Write a C program that asks for and reads in two integers and then reports if one is a multiple of the other.

  Write program which prompts user to enter numbers

Write down the program which prompts the user to enter numbers, findsout how many positive and negative values have been entered, and calculates sum and average of numbers entered.

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