Analyze an algorithm that finds the smallest numbers

Assignment Help Data Structure & Algorithms
Reference no: EM132264304

Question 1:

In the following, let f and g be positive increasing functions. Answer each question and briefly justify your answers. You get no points if you do not give a justification.

(a) Given that f (n) = O(g (n)), is it possible that f (n) = Θ(g (n))? Is it always true that f (n) = Θ(g(n))?
(b) Given that f (n) = ω(g (n)), is it possible that f (n) = Ω(g(n))? Is it always true that f (n) = Ω(g (n))?
(c) Given that f (n) = O(g (n)), is it possible that f (n) = o(g(n))? Is it always true that f (n) = o(g (n))?
(d) Is it possible that f (n) = ω(g(n)) and also f (n) = 0 (g (n))?
(e) Is it possible that f (n) + g(n) = 0(min( f (n), g(n)))? Is it always true that f (n) + g(n) = O(min( f (n), g(n)))?

Question 2.
Give two asymptotically different functions, each of which belongs to both ω(n) and o(n2) . Briefly justify your answers.

Question 3.
Problem 3-2 of the Textbook (p.61), (c) - (f). Note that "A is O of B" means A = O(B), and similarly for other notations (o, Ω, ω, Θ). In your write up, copy and fill up the table with "Yes" or "No" in each table entry; after the table, briefly justify your answer for each sub-question. You get no points if you do not give a justification.
(Note: 5 points for each of (c) - (f).)

Question 4.

Let S1(n) = Σnk=1 k, S2(n) = Σnk=1k2 and S3(n) = Σnk=1 k3. In class, we already showed how to calculate S1(n) and S2(n). Your task here is to apply similar methods for S3(n) .

(a) Without calculating the closed form, use rough estimations to derive a lower bound and an upper bound for S3(n), so that you can use them to express S3(n) in the Θ() notation. Give this Θ() notation in the simplest form (e.g., Θ() is in the simplest form but Θ(2n)) is not).

(b) Use the perturbation method (as discussed in class) to derive the closed form for S3 (n). (Background Information: You would need the formula of S1(n) and S2 (n), which we already know: S1(n) = n(n + 1)/2 and S2(n) = n(n + 1)(2n + 1)/6.)

Question 5.

Given a sequence of n unordered real numbers, design and analyze an algorithm that finds both the smallest and the second smallest numbers among them using at most 3 [n/2] comparisons. Your algorithm should describe what to do when n is even and when n is odd. You need to show that your algorithm gives the correct answers, and that it uses at most 3 [n/ 2] comparisons.

Reference no: EM132264304

Questions Cloud

Company and the capital budgeting methods : What are the impacts of the size of a company and the capital budgeting methods?
Total product per day and marginal product : (a) Compute the total product per day and the marginal product of labor for the first five workers.
Perpetuating discrimination in labor markets : What role do consumers play in perpetuating discrimination in labor markets?
Capital share of net domestic output : Consider a country with a capital share of net domestic output equal to 30%. Then, what is the minimum possible ratio of national income to net domestic output?
Analyze an algorithm that finds the smallest numbers : CS 6033: Design and Analysis of Algorithms - New York University - Design and analyze an algorithm that finds both the smallest and the second smallest numbers
Are preferential trading agreements welfare improving : Are preferential trading agreements welfare improving? What factors determine the welfare changes of such agreement?
Imposing a tax on those who watch the fireworks : What do you say to the idea of a city government imposing a tax on those who watch the fireworks? Give me two reasons to support it, and two reasons not to supp
How might such an oversight affect our conclusions : In 1984, individual balances in private retirement plants were $865 billion. Thirty years later, they had risen to almost $25 trillion.
Consider two people who are both equally rich : Does envy of those who are rich depend on the source of that wealth? For example, consider two people who are both equally rich. One of them worked eighty hours

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

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