Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose you are given a sequence or array of n real numbers: (a1, a2, . . . , an). We are interested in sorting this

Suppose you are given a sequence or array of n real numbers: (a1, a2, . . . , an). We are interested in sorting this list, and ideally sorting it as efficiently as possible / with minimal effort. We can summarize the total ordering information in terms of a permutation of the numbers 1 to n. For instance, given (a1, a2, a3), a total ordering permutation of 3, 1, 2 would tell us that a3 ? a1 ? a2, and therefore that the sorted form of the list would be (a3, a1, a2).

1) How many possible total ordering permutations are there?

2) Argue that if you know or are given the total ordering permutation, then you can sort the list without any additional comparisons or tests.

3) Argue that if you dont know the total ordering permutation (or only know partial / incomplete information about it), you cannot sort the list without additional comparisons or tests.

4) Taking this view, argue that any sorting algorithm must do at least enough work to determine the total order permutation of the list.

5) If every element comparison (testing whether ai ? aj ) provides one bit of information, argue you need at least on the order of ln(n!) many tests/comparisons to sort the list.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

OCA Oracle Database SQL Exam Guide Exam 1Z0-071

Authors: Steve O'Hearn

1st Edition

1259585492, 978-1259585494

More Books

Students also viewed these Databases questions

Question

l List and define several types of international employees.

Answered: 1 week ago

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago