Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Q23E

Page 216

Suppose that you have two different algorithms for solving a problem. To solve a problem of size n, the first algorithm uses exactly \(n(\log n)\)operations and the second algorithm uses exactly \({n^{\frac{3}{2}}}\) operations. As \(n\) grows, which algorithm uses fewer operations?

Q23SE

Page 233

Find an integernwithn>2for whichn2100<2n.

Q24E

Page 230

An algorithm is called optimal for a solution of a problem with respect to a specified operation if there is no algorithm for solving this problem using fewer operations.

a) Show that Algorithm 1 in Section 3.1 is an optimal algorithm with respect to the number of comparisons of integers.[Note: Comparisons used for bookkeeping in the loop are not of concern here.]

b) Is the linear search algorithm optimal with respect to the number of comparisons of integers (not including comparisons used for bookkeeping in the loop)?

Q24E

Page 216

Suppose that you have two different algorithms for solving a problem. To solve a problem of size n, the first algorithm uses exactly \({n^2}{2^n}\)operations and the second algorithm uses exactly \(n!\) operations. As \(n\) grows, which algorithm uses fewer operations?

Q24E

Page 203

Describe an algorithm that determines whether a function from a finite set to another finite set is one-to-one.

Q24SE

Page 233

Find an integer nwithn>2for which(logn)2100<n.

Q25E

Page 203

Describe an algorithm that will count the number of 1s in a bit string by examining each bit of the string to determine whether it is a 1 bit.

Q25E

Page 231

Describe the worst-case time complexity, measured in terms of comparisons, of the ternary search algorithm described in Exercise 27 of Section 3.1.

Q25E

Page 216

Give as good a big-O estimate as possible for each of these functions.

\(\begin{aligned}{*{20}{l}}{a){\rm{ }}\left( {{n^2}{\rm{ }} + {\rm{ }}8} \right)\left( {n{\rm{ }} + {\rm{ }}1} \right)}\\{b){\rm{ }}\left( {n{\rm{ }}log{\rm{ }}n{\rm{ }} + {\rm{ }}{n^2}} \right)\left( {{n^3}{\rm{ }} + {\rm{ }}2} \right)}\\{c){\rm{ }}\left( {n!{\rm{ }} + {\rm{ }}2n} \right)\left( {{n^3}{\rm{ }} + {\rm{ }}log\left( {{n^2}{\rm{ }} + {\rm{ }}1} \right)} \right)}\end{aligned}\)

Q25SE

Page 233

Arrange the functionsnn,(logn)2,n1.0001,(1.0001)n,2log2nandn(logn)1001in a list so that each function is big-O of the next function. [Hint: To determine the relative size of some of these functions, take logarithms]

Access millions of textbook solutions in one place

  • Access over 3 million high quality textbook solutions
  • Access our popular flashcard, quiz, mock-exam and notes features
  • Access our smart AI features to upgrade your learning
Get Vaia Premium now
Access millions of textbook solutions in one place

Recommended explanations on Math Textbooks