Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Sorting Exercises - File Processing | CSCI 2230, Assignments of Digital Signal Processing

Material Type: Assignment; Professor: Pine; Class: File Processing; Subject: Computer & Information Science (CSCI); University: East Tennessee State University; Term: Unknown 1989;

Typology: Assignments

Pre 2010

Uploaded on 08/18/2009

koofers-user-8df-1
koofers-user-8df-1 🇺🇸

10 documents

1 / 4

Toggle sidebar

Related documents


Partial preview of the text

Download Sorting Exercises - File Processing | CSCI 2230 and more Assignments Digital Signal Processing in PDF only on Docsity! Sorting Exercises Insertion Sort 1. Perform Insertion Sort on the list {7, 3, 9, 4, 2, 5, 6, 1, 8} Showing the resulting list after each pass a. How many exchanges were made? b. How many comparisons were made? c. Demonstrate that a list of 9 elements, in increasing order, produces the best performance (count the comparisons and swaps). d. Demonstrate that a list of 9 elements, in decreasing order, produces the worse performance (count the comparisons and swaps). Selection Sort 1. Perform Selection Sort on the list {7, 3, 9, 4, 2, 5, 6, 1, 8} Showing the resulting list after each pass a. How many exchanges were made? b. How many comparisons were made? c. What is the performance for a list in increasing order? d. What is the performance for a list in decreasing order? Bubble Sort 1. Perform Bubble Sort on the list {7, 3, 9, 4, 2, 5, 6, 1, 8} Showing the resulting list after each pass a. How many exchanges were made? b. How many comparisons were made? c. What is the performance for a list in increasing order? d. What is the performance for a list in decreasing order? Shell Sort 1. Show the results of each pass of Shell Sort, using increments of 5, 2, 1 on the list {7, 3, 9, 4, 2, 5, 6, 1, 8}. a. How many comparisons were made? Heap Sort 1. Perform a heap sort on the list, {7, 3, 9, 4, 2, 5, 6, 1, 8}, showing the heap on each pass. a. How many comparisons were made? Merge Sort 1. Show the results of the list on each pass of Merge Sort on the list {7, 3, 9, 4, 2, 5, 6, 1, 8}. a. How many comparisons were made? Quick Sort 1. Show the results of the list on each pass of Quick Sort on the list {7, 3, 9, 4, 2, 5, 6, 1, 8}. Use the first value as the pivot element. a. How many comparisons were made? Radix Sort 1. Show the results of the list on each pass of Radix Sort on the list {1405, 975, 23, 9803, 4835, 2082, 7368, 573, 804, 746, 4703, 1421, 4273, 1208, 521, 2050}. a. Show the buckets at each step and the list after coalescing step. Simple External Merge Sort Use this data in the following problems: {28, 15, 23, 5, 30, 32, 62, 4, 50, 2, 12, 8, 9, 27, 55, 64, 13, 48, 7, 40, 35, 31, 14, 1, 6, 17, 29, 49, 25, 3} Assume a max buffer size of 6 integers. 1. For Phase 1 (sort phase) use all 6 integer slots for the read / write buffer. 2. For Phase 2 (merge phase) use a 2-way merge( 3 buffers of 2 integer slots each ). Determine the number of read / write operations for each phase.
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved