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

  Create a class named gamer that has a field for name

Create a class named Gamer that has a field for name(string) and a field for points(int).

  A hierarchical jpeg encode decoder for greyscale images

This project is to develop a program that implements a hierarchical JPEG encoder/decoder for greyscale images.

  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.

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

  Searching f and removing certain states from the hash table

use the class hashT, ''Hashing: Implementation Using Quadratic Probing,'' which uses quadratic probing to resolve collision, to create a hash table to keep track of each state's information. Use the state's name as the key to determine the hash addre..

  A perfect solution is impossible or too expensive

Optimization is often encountered in engineering problems. More often than not, a perfect solution is impossible or too expensive to find and implement. Therefore, we resort to sub-optimal, yet useful, solutions. This assignment tackles a classical p..

  C assignment of curl library

C Assignment Curl library must be used To be done on linux, it should be compiled using the following command: gcc -Wall -ansi -pedantic NameOfFile.c -lncurses Please make sure it is commented with clarification Variable names in camel case

  Write a program that reads from a file a list of course name

Write a program that reads from a file a list of course names, letter grades for each course and number of credits each course is worth. The program will read each course name, grade earned and number of credits from the file and print out the course..

  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.

  Main program should instantiate an instance

The main program should instantiate an instance of the class Rectangle and then make calls to the member functions to input the data and output the results

  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?

  Sort an array of elements using the quick sort algorithm

Sort an array of 10,000 elements using the quick sort algorithm as follows: sort the array using pivot as the middle element of the array

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