Question: ( Q 1 ) [ 2 5 pts . ] Solve Problem 4 . 4 8 ( a , b , c ) from Baase
Q pts Solve Problem abc from Baases textbook, page
To sort or not to sort: Outline a reasonable method of solving each of the following problems. Give the order of the worstcase complexity of your methods.
You are given a pile of thousands of telephone bills and thousands of checks sent in to pay the bills. Assume telephone numbers are on the checks. Find out who didnt pay.
You are given an array in which each entry contains the title, author, call number, and publisher of all the books in a school library and another array of publishers. Find out how many of the books were published by each of those companies.
You are given an array containing checkout records of all the books checked out of the campus library during the past year. Determine how many distinct people checked out at least one book.
Q pts Solve Problem ah from Baases textbook, page
A sorting method is stable if equal keys remain in the same relative order in the sorted sequence as they were in the original sequence. That is a sort is stable if for any i j such that initially Ei Ej the sort moves Ei to Ek and Ej to Em for some k and m such that k m Which of the following algorithms are stable? For each that is not stable, give the relative order of two equal keys is changed.
a Insertion Sort.
b Maxsort Exercise
c Bubble Sort Exercise
d Quicksort.
e Heapsort.
f Mergesort.
g Shellsort.
h Radix Sort.
Q pts Given the following file:
Sort this file by hand using Heapsort and answer the following questions:
a Draw the initial COMPLETE tree representation of the file BEFORE the HEAP is created.
b Draw the initial heap.
c Continue with the sort for two iterations PAST the initial heap ie you pop off and from the root. NOW RESTRUCTURE THE HEAP AFTER is popped what is the NEW ROOT?
Q pts Use Quicksort as shown in class and sort the following file by hand and selecting the first element as the split element:
a After the initial swapping, there are two subfiles one to the left of and one to the right of What are they in order?
b Continue sorting the entire file until totally sorted. During the entire sort what was the maximum number of inversions removed by a single comparison and swap?
I want questions and to be less theoretical and should show work in detail.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
