1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
olchik [2.2K]
3 years ago
14

In this problem you will test and analyze the following sorting algorithms: Selection, Bubble, Insertion, Merge, and Quick. You

can use the code provided in the lecture slides after modifying it to meet the following requirements: 1. Analyze the algorithms by sorting, in ascending order, arrays of 1000 integers (i.e., no need to use template functions as in the lecture slides). 2. Create three arrays of 1000 integers: BST, AVG, and WST. Where a. BST has 1000 integers already sorted in ascending order (e.g., 10, 20, 30, ...etc.). b. AVG has 1000 randomly generated integers, where each integer is between 0 and 100,000. c. WST has 1000 integers sorted in reverse order (e.g., 1000, 990, 980, ...etc.). 3. Test the five sorting algorithms with three 1000‐integer arrays: tBST, tAVG, and tWST. Before testing each algorithm, these three arrays (tBST, tAVG, and tWST) must be re‐initialize as copies from BST, AVG, and WST respectively (you can write a function to carry out the copy task). This is to make sure that all algorithms are tested with an identical set of arrays.
Computers and Technology
1 answer:
Tpy6a [65]3 years ago
5 0

Answer:

1) Selection, bubble and insertion sort requires no moves in the sorted array because there will be n comparisons in the array and no swapping would take place after each comparison so zero moves.

2) Bubble and insertion sort result in 999 comparisons as we are required to iterate only one time over the array. this can be easily explained from the diagram as in bubble sort all the elements will be in their sorted position so each element will be encountered only once.

3) In selection sort, any element is compared with all the elements and accordingly smaller is paced first so in the reverse sorted array there will be at least n^2 comparisons so n^2 moves.

4) in merge sort an array is always divided into n nos of parts and then sorted so in worst case as well as best case the array will be divided so same numbers of moves.

You might be interested in
If you’re storing some personal information like Debit/Credit card numbers or Passwords etc, on different sites for running you’
Nadusha1986 [10]

Answer:

hacker can steal your data in many ways.

Explanation:

if you allow cookie site for fake websites. It can absolutely be possible.

5 0
3 years ago
What is LINUX?
valkas [14]

Answer:

The answer is A

Explanation:

I know what it is.

4 0
3 years ago
Read 2 more answers
In a three-tier architecture, the component that runs the program code and enforces the business processes is the:_______.
madam [21]

Answer:

Application Server

Explanation:

The Application Server is a component in computer engineering that presents the application logic layer in a three-tier architecture.

This functionality allows client components to connect with data resources and legacy applications.

In this process of interaction, the Application Server runs the program code from Tier 1 - Presentation, through Tier 2 - Business Logic to Tier 3 - Resources, by forcing through the business processes.

8 0
3 years ago
What development first helped people shape their communities through<br> informed decisions?
uranmaximum [27]

Answer:

The development of a simplified alphabet.

Explanation:

3 0
3 years ago
What type of encryption is this "1d83ad29cf19ff399445aff3a0da74d9"
bija089 [108]

Due to the length of the hash I'm going to say it's MD5

7 0
3 years ago
Other questions:
  • 7. What is the school campus’s setting<br> the school is sanford
    6·2 answers
  • What is the maximum number of fonts that should be used on a slide?
    13·1 answer
  • Complex communication skills will probably never be outsourced to a computer because they require the human touch.
    8·1 answer
  • 2. Billys teacher asked him to type a report about asian food. Which paragraph format should he use?
    12·2 answers
  • What is the information that there are 24 hours in a day and 365 days in a year considered?
    6·2 answers
  • A ______________ is a way of taking a screenshot or a picture of your computer screen. ​
    14·1 answer
  • Miguel owns a tile business. He has two employees who work in a small office. One answers phones and schedules appointments. Ano
    11·2 answers
  • Write a C program to calculate and display the coordinates of midpoint - M of a linesegment between two given points - say A and
    7·1 answer
  • How is science and technology used in the society​
    11·1 answer
  • In cell b12 create a formula using max f7nction to calculate maximum value in B4:B9
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!