Chapter 1: Problem 21
Discuss the reflexive, symmetric, and transitive properties for asymptotic comparisons \((O, \Omega, \theta, o)\)
Chapter 1: Problem 21
Discuss the reflexive, symmetric, and transitive properties for asymptotic comparisons \((O, \Omega, \theta, o)\)
All the tools & learning materials you need for study success - in one app.
Get started for freeAlgorithm A performs \(10 n^{2}\) basic operations, and algorithm B performs \(300 \ln n\) basic operations. For what value of \(n\) does algorithm \(\mathrm{B}\) start to show its better performance?
Suppose you have a computer that requires I minute to solve problem in stances of size \(n=1000 .\) What instance sizes can be run in 1 minute if you buy a new computer that runs 1000 times faster than the old one, assuming the following time complexities \(T(n)\) for our algorithm? (a) \(T(n) \in \Theta(n)\) (b) \(T(n) \in \Theta\left(n^{3}\right)\) (c) \(T(n) \in \Theta\left(10^{n}\right)\)
Write an algorithm that determines whether or not an almost complete binary tree is a heap.
What is the time complexity \(T(n)\) of the nested loops below? For simplicity, you may assume that \(n\) is a power of \(2 .\) That is, \(n=2^{k}\) for some positive integer \(k\) \(:\) \\[ \begin{array}{} \text { for }(i=1 ; i<=n, i++)\\} \\ \ \begin{array}{} j=n \\ \text { while }(j>=1)\\{ \end{array} \end{array} \\] < body of the while loop> \(\quad\) I/ Needs \(\Theta(1)\) \\[ j=\lfloor j / 2\rfloor \\] } }
Give an algorithm for the following problem, and determine its time complexity. Given a list of \(n\) distinct positive integers, partition the list into two sublists, each of size \(n / 2\), such that the difference between the sums of the integers in the two sublists is maximized. You may assume that \(n\) is a multiple of 2
What do you think about this solution?
We value your feedback to improve our textbook solutions.