Assume that the following 8 numbers are elements of an array (7pt).
8, 7, 6, 5, 4, 3, 2, 1.
sub parts c and d are not required in merge sort
Because time complexity in all cases are equal O(nlogn)
Anything doubtful or not understand or missing just comment
Don't be dislike
Thank you and all the best
Assume that the following 8 numbers are elements of an array (7pt). 8, 7, 6, 5,...
Let us suppose that there are n elements in the un-sorted array. Answer the following? q1: How is merge sort different from quick sort? q2: What is the split ratio in merge sort? q3: What is the worst-case/average-case/best-case running time of Merge Sort? q4: Why is the worst case running time of Merge sort O(n log n) always? q5: Why does Merge Sort use a static tree in the recursion process? (It is worth noting that the Quick Sort use...
6 6. Merge Bubble Sort: a) How does the merge bubble sort break the array into sublists? b) What does it need to use for each sublist and then what does it do with all of the sublists? c) What is the Big-O notation for this sort? 7. Merge Sort: a) How does the merge sort use recursion to break the array into sublists? b) What happens to each of these sublists to get the final sorted list? c) What...
7. (14 points) Use LSD-first Radix Sort algorithm to sort the following array of numbers. Write the worst case, the best case time complexity and discuss if these sorting algorithms are stable and in-place? In what cases using these algorithms would not be efficient? (You must run Counting Sort for each digit explicitly.) A=[22,15,16,13,23,45,0,23,123]
Sort the same array [3, 5, 1, 4, 8, 7,9, 2] in the ascending order by applying the Merge sort algorithm. Write down the intermediate results step by step in a tree structure. (20 points)
Given the array A = (5, 7, 14, 8, 11, 15, 9, 13, 12, 10), show how the Insertion sort and Quicksort algorithms work. Step through each algorithm, illustrating how it modifies the input array A. State the worst- and best-case computational complexity of the two algorithms in terms of the size |A| of the input array, and explain why.
Given an unsorted array. The array has this property that every element in array is at most k distance from its position in sorted array where k is a positive integer smaller than size of array. Which sorting algorithm can be easily modified for sorting this array and what is the obtainable time complexity? Group of answer choices nsertion Sort with time complexity O(kn) Heap Sort with time complexity O(nLogk) Quick Sort with time complexity O(kLogk) Merge Sort with time...
2.1 Searching and Sorting- 5 points each 1. Run Heapsort on the following array: A (7,3, 9, 4, 2,5, 6, 1,8) 2. Run merge sort on the same array. 3. What is the worst case for quick sort? What is the worst case time com- plexity for quick sort and why? Explain what modifications we can make to quick sort to make it run faster, and why this helps. 4. Gi pseudocode for an algorithm that will solve the following...
Please answer in Java for an immediate upvote :) Given the following array of 8 elements, trace the merge sort algorithm. Assume the array is to be sorted in ascending order. 81 16 4 6 34 11 23 67 ANSWER: (Hint 6 – lines): Why don’t we select the median element of all the n-entries in the array to be our pivot point? ANSWER:
Given an array of numbers, you want to find out the three greatest numbers. Do you have to sort the array, or is there a faster way than applying a sorting algorithm? Explain why you use or not use sorting in terms of the worst-case running time. Give an example.
Subject: Algorithm need this urgent please. 2.1 Searching and Sorting- 5 points each 1. Run Heapsort on the following array: A 17, 3, 9, 4, 2,5, 6, 1,8) 2. Run merge sort on the same array 3. What is the worst case for quick sort? What is the worst case time com- plexity for quick sort and why? Explain what modifications we can make to quick sort to make it run faster, and why this helps. 2.1 Searching and Sorting-...