Question

Using the following data set: 10, 5, 2, 7, 20, 3, 13 a) Apply the bubble...

Using the following data set:

10, 5, 2, 7, 20, 3, 13

a) Apply the bubble sort algorithm [Show the first and second iterations only]

b) Apply the insertion sort algorithm [Show the first four iterations only]

Homework Answers

Answer #1

a)

b)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Sorting – Insertion Sort Sort the list 0, 3, -10,-2,10,-2 using insertion sort, ascending. Show the...
Sorting – Insertion Sort Sort the list 0, 3, -10,-2,10,-2 using insertion sort, ascending. Show the list after each outer loop. Do this manually, i.e. step through the algorithm yourself without a computer. This question is related to data structure and algorithm in javascript (.js). Please do not copy from stackabuse or stackoverflow, Please explain that algorithm with comments. i really want to learn this concept.
23 30 35 43 4 10 22 4 Complete the following: a) Use the bubble sort...
23 30 35 43 4 10 22 4 Complete the following: a) Use the bubble sort to sort the values showing the order of the values in the list after every pass of the sorting algorithm.   b) What is the time complexity of the sort (use the number of comparisons required as a measure of time.)    c) Modify the algorithm so it stops if there are no swaps in a complete pass. How many comparisons would be needed in your...
   vi. Assume that a linked list stores the data, 20, 11, 13, 19, 12, 14...
   vi. Assume that a linked list stores the data, 20, 11, 13, 19, 12, 14 in that order. Assume that Node head references the first item in the list. What is the result to the linked list of       the following instructions? Assume that newNode          is a Node, already constructed. newNode.data = 1;                         newNode.next = head.next;                         head = newNode;       a. The value 1 is inserted into the linked list before 20       b. The...
Given the following sample data set. X= 2 3 5 6 6 Y= 10 9 7...
Given the following sample data set. X= 2 3 5 6 6 Y= 10 9 7 4 2 a. Draw a scatter diagram of the data. (using Ti 84) b. Compute the correlation coefficient r. Then use 0.05 significance level to test whether there is a linear correlation between x and y. (using Ti 84)
out of the following four: 1.Bubble sort 2. Insertion sort 3. Quicksort 4. Mergesort a. Which...
out of the following four: 1.Bubble sort 2. Insertion sort 3. Quicksort 4. Mergesort a. Which sorting methods perform best and worst for data sizes ≥ 25,000 when the input data is random? b. Which sorting methods perform best and worst for data sizes ≥ 25,000 when the input data is 90% sorted? c. Which sorting methods perform best and worst for data sizes ≥ 25,000 when the input data is reverse sorted? d. Which sorting methods perform best and...
Consider the data set: 2, 10, 3, 7, 11, 13, 8, 4, 2, 15, 37, 88,...
Consider the data set: 2, 10, 3, 7, 11, 13, 8, 4, 2, 15, 37, 88, 111, 23, 21, 22, 16, 43, 1, 3, 6, 19, 8, 14, 20, 233, 1, 25, 17 (a) By glancing at this data set, would you expect the sample mean to be greater than the median, or smaller than the median? greater than the median Correct: Your answer is correct. (b) By how much do the sample mean and sample median differ? (To answer...
Consider the following page reference string: 7, 2, 3, 1, 2, 5, 3, 7, 6, 7...
Consider the following page reference string: 7, 2, 3, 1, 2, 5, 3, 7, 6, 7 Assuming demand paging with three frames, how many page faults would occur for the following replacement algorithms? Show your working. First in First out Least Recently Used Optimal Replacement Calculate the no. of page faults for each algorithm. Which algorithm performs best for the given reference string?
Giving an array of integers A[1:8] ={5, 1, 3, 2, 7, 6, 8, 4}. Build a...
Giving an array of integers A[1:8] ={5, 1, 3, 2, 7, 6, 8, 4}. Build a MAX-HEAP on A. Show the steps using binary tree representation or array view. Use heap sort: show the array after the first, the second, and the third of heap sort
1.) Perform the following multiplication using Booth’s algorithm: (You will receive full credit only if you...
1.) Perform the following multiplication using Booth’s algorithm: (You will receive full credit only if you show all your work)      13 x -13 (a) 27/4 Using paper pencil approach and (b) simulate how a machine does this job 2.)Perform the following division as directed: (a) 27/4 using non-restoring division algorithm // we need 4 quotient bits. (b) Using Newton-Raphson algorithm find 1/d when d=0.84 // show the results of the first 3 iterations 3.) A real-time computer system has...
DSAFGG1234123 Consider the following two sample data sets.               Set 1: 13 25   16   28   20   ...
DSAFGG1234123 Consider the following two sample data sets.               Set 1: 13 25   16   28   20                      Set 2: 2 7       0     8      5 a.Calculate the coefficient of variation for each data set. b.Which data set has more variability?