Question: 1. Manually trace insertion sort, selection sort, bubble sort, merge sort and radix sort when 10. 2. Implement insertion sort, selection sort, bubble sort, merge

1. Manually trace insertion sort, selection sort, bubble sort, merge sort and1. Manually trace insertion sort, selection sort, bubble sort, merge sort and radix sort when 10. 2. Implement insertion sort, selection sort, bubble sort, merge sort and radix sort ascendingly when n = 10 and n = 50 for sorted and unsorted data. Conclude your experiment. 3. Implement insertion sort, selection sort, bubble sort, merge sort and radix sort descendingly when n = 10 and n = 50 for sorted and unsorted data. Conclude your experiment. 4. Given a list of unsorted integers, A = {a, az .. , an} find the pair of elements that have the smallest absolute difference between them? If there are multiple pairs, find them all.

Lab 6 - Sorting 1. Manually trace insertion sort, selection sort, bubble sort, merge sort and radix sort when n= 10. 2. Implement insertion sort, selection sort, bubble sort, merge sort and radix sort ascendingly when n = 10 and n = 50 for sorted and unsorted data. Conclude your experiment. 3. Implement insertion sort, selection sort, bubble sort, merge sort and radix sort descendingly when n = 10 and n = 50 for sorted and unsorted data. Conclude your experiment. 4. Given a list of unsorted integers, A = {a1, A2, ..., an} find the pair of elements that have the smallest absolute difference between them? If there are multiple pairs, find them all. Input Format The first line of input contains a single integer, N, representing the length of array. In the second line, there are N space-separated integers, di, d2, ..., an , representing the elements of array A. Output Format Output the pairs of elements with the smallest difference. If there are multiple pairs, output all of them in ascending order, all on the same line (consecutively) with just a single space between each pair of numbers. If there's a number which lies in two pair, print it two times (see the sample case #2 for explanation). Sample Input #1 10 -20 -3916237 -357920 -3620601 7374819 -7330761 30 6246457 -6461594 266854 Sample Output #1 - 20 30 Explanation (30) - (-20) = 50, which is the smallest difference. Sample Input #2 4 5 4 3 2 Sample Output #3 2 3 3 4 4 5 Explanation Here, the minimum difference will be 1. So valid pairs are (2, 3), (3, 4), and (4, 5). So we have to print 2 once, 3 and 4twice each, and 5 once

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!