Explain algorithm from is optimal by proving lower bound

Assignment Help Data Structure & Algorithms
Reference no: EM1372058

(a) You are given two inputs: an integer k, and an array A containing n integers. Give an algorithm to find any one of the k smallest elements of A, using at most n - k comparisons. (In other words, your algorithm must return one of the k smallest elements of A, but it doesn't matter which one.) Explain why your algorithm is guaranteed to find a correct answer and why it satisfies the bound on the running time. (Hint: there is a very easy way to solve this problem).

(b) Show that your algorithm from (a) is optimal by proving a lower bound of n - k on the number of comparisons required to solve the problem.

Reference no: EM1372058

Questions Cloud

Describe why algorithm runs in on time : Assume you have the array A of n items, and you want to find k items in A closest to the median of A. Describe why your algorithm runs in O(n) time.
Disucss the influences of price elasticity of demand : Post a memo to explain the factors that contribute to the elasticity of goods. Also incorporate a real-life example of price elasticity of demand, and discuss how it impacts the economy.
Major methods of sociological research : Discuss how each of the major methods of sociological research - experiment, survey, participant observation, and secondary research - are suitable for helping us to answer different types of questions and to study different situations.
Source of knowledge in terms of strengths : Evaluate each source of knowledge in terms of its strengths and limitations as it applies to how your discipline obtains knowledge.
Explain algorithm from is optimal by proving lower bound : Illustrate that your algorithm from (a) is optimal by proving lower bound of n - k on number of comparisons required to solve the problem.
Short run and long run cost analysis : Using the data in the following table, Complete the last two columns by replacing the * with the correct values and create the following curves in one chart.
Significance of gender role socialization : Discusses the significance of gender role socialization. What do toys suggest regarding the gender role expectations of boys and girls?
Idea of hidden curriculum : Explain and critically discuss the idea of the hidden curriculum. In what way(s) does this concept reinforce the notion of education being a gendered institution?
Calculate the maximum profit, price and quantity : The manufacturer of high quality flatbed scanners is trying to decide what price to set for product. The cost of production and the demand for product are assumed to be as follows:

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Create divide and conquer algorithm to solve problem

Create a divide and conquer algorithm to solve problem. The time complexity of your algorithm must be O(nlgn) or better.

  Algorithm to produce schedule for least completion time

What is the best order for sending people out, if one wants whole competition to be over as early as possible? More precisely, provide efficient algorithm which produces schedule whose completion time is as small as possible.

  Efficient algorithm that achieves goal using base station

So that every house is within four miles of one of the base stations. Write efficient algorithm that achieves this goal, using as few base stations as possible.

  Determining ciphertext generated by encryption

Determine ciphertext (in binary form) generated by encryption of character X?

  Write algorithm using pseudo code consensus algorithm

Write an algorithm, using pseudo code, "Consensus algorithm": A group of ten people need to decide which one flavor of ice cream they will all order, out of three options.

  Computing minimal length of key-average cracking time given

If Encrypt-It-Rite would like to increase average cracking time to at least 100 years, determine the minimal length of the key?

  Computing hash value for message

For a message, he computes the hash value H = (VChar 1 x VChar 2 x VChar 3 ...x VChar N) mod(26).

  Explain method for combining two trees-heap-order property

Assume two binary trees, T 1 and T 2 , hold entries satisfying heap-order property. Explain method for combining T 1 and T 2 into a tree T whose internal nodes hold union of entries

  Effective address-addressing mode of instruction is direct

Evaluate the effective address if the addressing mode of the instruction is (a) direct; (b) immediate; (c) relative; (d) register indirect.

  Sort array of elements using the quick sort algorithm

"sort an array of 10,000 elements using quick sort algorithm as follows: sort the array using pivot as middle element of the array

  Write algorithm in pseudo code for bank account

Write an algorithm in pseudo code to settle following question: A bank account starts out with $10,000. Interest is compounded monthly at 6% per year(0.5% per month).

  Calculate best and worst-case speedup for centralized scheme

Suppose that it doesn't take any time to allot work to process, calculate best- and worst-case speedup for centralized scheme for dynamic mapping with two processes.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd