Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Consider finding the median of three order-able elements A, B, and C: (a) Design an optimal algorithm to find the median. (b) Draw the

1. Consider finding the median of three order-able elements A, B, and C: (a) Design an optimal algorithm to find the median. (b) Draw the possible posets after two comparisons. How do these posets show that your algorithm has optimal worst case cost? (c) Draw the decision tree for your algorithm and explain how the decision tree gives the worst case cost.

2. Consider determining if at least three of five integer values are non-zero using only operations of testing for equality to zero. Give an adversary strategy to force any algorithm to examine all of the five values. Explain why your adversary strategy works regardless of what comparison algorithm is used.

3. Use an adversary argument to prove a lower bound (an optimal worst case behavior) for any algorithm which determines if there are any duplicates in a sorted array of size n. In other words, how many comparisons can the adversary force any algorithm to perform and what strategy does the adversary use? (Remember that the adversarys answers must be consistent.)

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

Students also viewed these Databases questions

Question

What is cost plus pricing ?

Answered: 1 week ago

Question

1. What are the types of wastes that reach water bodies ?

Answered: 1 week ago

Question

Which type of soil has more ability to absorb water?

Answered: 1 week ago

Question

Have roles been defined and assigned?

Answered: 1 week ago

Question

Are these written ground rules?

Answered: 1 week ago

Question

How do members envision the ideal team?

Answered: 1 week ago