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

  Write schedule produced by earliest deadline first algorithm

Given below are two sets of real-time, periodic tasks. For (a), will the schedule produced by Earliest Deadline First algorithm meet all the deadlines?

  Write algorithm to decide which commute is cheaper

Write working algorithm in pseudo code to decide which commute is cheaper: You wish to decide whether you must drive your car to work or take train. You know one-way distance

  Describe sorting algorithm to be parsimonious

Describe a sorting algorithm to be parsimonious if it never compares same pair of input values twice. (Supose that all the values being sorted are distinct.).

  Describe ambiguity in proposed algorithm

Describe the distinction between an ambiguity in a proposed algorithm and an ambiguity in the representation of an algorithm. Describe how the use of primitives helps remove ambiguities in an algorithm's representation.

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  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.

  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.

  Online vs. face-to-face classes

Communication A significant distinction between online and face-to-face classes lies in the area of communication.

  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.

  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

  Users and it organizations arm against phishing attacks

How users and IT organizations must arm themselves against these attacks?

  Write algorithm to reverse elemens in queue

Using basic queue and stack operationns, write algorithm to reverse elemens in the queue. Suppose that 'Stack' is class described in section with 'StackType' set to int and STACK_CAPACITY

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