If there's anything else you need, please mention it in the comments section.
2. Sort the following numbers using counting sort 8 11 4 7 6 912 Index Sum...
Sort the numbers: 2, 1, 4, 5, 7, 1, 7, 11, 8, 9 using the counting sort.
Write a program in Java that performs the Counting Sort algorithm. a) Create the countingSort method. Use the pseudocode shown in the lecture. b) Test your codes by writing a program that uses the following input array: int[] array_A = {6, 0, 2, 0, 1, 3, 4, 6, 1, 3, 2}; c) Your output should display the following versions of the arrays: I. The original input array A II. The counting array C after the counting (lines 4-5 in pseudocode)...
Counting numbers are to be formed using only the digits 6, 8, and 9. Determine the number of different possibilities for the type of number described below. Four-digit numbers with one pair of adjacent 6s and no other repeated digits (Hint: You may want to split the task of designing such a number into three parts, such as (1) position the pair of 6s, (2) position the 8, and (3) position the 9.)
Sort the sequence 3, 10, 7, 2, 11, 6, 9, 4 using Merge sort. Show the intermediate steps .
Question 3 (2 points) Linear time sort a) Call COUNTING-SORT on the input array A (6,0,2,0,1,3,4,6,1,3,2). Using the plots on slide #67 as a model, illustrate array C after the second for loop (line 5 to 6) and the third for loop (line 7 to 8) are executed, respectively; then illustrate array B and C after executing the first 2 iterations of the fourth for loop (line 10 to 12), respectively Using the plots on slide #81 as a model,...
Just show
Paper-2 1. Sort the following numbers using Bubble sort 17 12 19 11 5 8 10 2
4) [15 points total (5 points each)] Assume you are given a sorted array A of n numbers, where A is indexed from 1 up to n, anda number num which we wish to insert into A, in the proper sorted position. The function Search finds the minimum index i such that num should be inserted into Ali]. It searches the array sequentially until it finds the location i. Another function MakeRoom moves A[i], .., AIn] to Ali+1]...AIn+1] same sort...
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]
Using an insertion sort, sort the array 5, 7, 4, 9, 8, 6, 3 into ascending order. After the first swap, what will the array look like?
Sort the sequence of integers { 2 ,5 ,4 , 6 , 3, 7, 8, 1} (show steps, do not write code) (20 points) Using Insertion Sort