Exam 3: Algorithms

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

Find the best  big- O function for n3+sin⁡n7. \text { big- } O \text { function for } n ^ { 3 } + \sin n ^ { 7 } \text {. }

(Short Answer)
5.0/5
(75)

In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1, log⁡2n,n,nlog⁡2n,n2,n3,…,2n,n!\log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n ! -The number of print statements in the following: while n>1n > 1 print "hello"; n:=⌊n/2⌋n : = \lfloor n / 2 \rfloor

(Short Answer)
4.8/5
(97)

Use the definition of big- OO to prove that 12+22+⋯+n21 ^ { 2 } + 2 ^ { 2 } + \cdots + n ^ { 2 } is O(n3)O \left( n ^ { 3 } \right)

(Short Answer)
4.9/5
(82)

In questions find the best big-O function for the function. Choose your answer from among the following: 1, log⁡2n,n,nlog⁡2n,n2,n3,…,2n,n!\log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n ! - 3n4+log⁡2n83 n ^ { 4 } + \log _ { 2 } n ^ { 8 }

(Short Answer)
4.8/5
(83)

assume that the number of multiplications of entries used to multiply a p × q and a q × r matrix is pqr. -What is the most efficient way to multiply the matrices A1,A2,A3 of sizes 10×50,50×10,10×40 ? \mathbf { A } _ { 1 } , \mathbf { A } _ { 2 } , \mathbf { A } _ { 3 } \text { of sizes } 10 \times 50,50 \times 10,10 \times 40 \text { ? }

(Short Answer)
4.9/5
(94)

Prove that x3+7x2+32x+1\frac { x ^ { 3 } + 7 x ^ { 2 } + 3 } { 2 x + 1 } is Θ(x2)\Theta \left( x ^ { 2 } \right) .

(Essay)
5.0/5
(81)

Use the definition of big- OO to prove that 13+23+⋯+n31 ^ { 3 } + 2 ^ { 3 } + \cdots + n ^ { 3 } is O(n4)O \left( n ^ { 4 } \right)

(Short Answer)
4.9/5
(70)

Show how the binary search algorithm searches for 27 in the following list: 5 6 8 12 15 21 25 31.

(Short Answer)
4.9/5
(73)

Let f(n)=3n2+8n+7f ( n ) = 3 n ^ { 2 } + 8 n + 7 . Show that f(n) is O(n2)O \left( n ^ { 2 } \right) .find C and k from the definition.

(Essay)
5.0/5
(77)

In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1, log⁡2n,n,nlog⁡2n,n2,n3,…,2n,n!\log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n ! -A binary search of n elements.

(Short Answer)
4.8/5
(74)

In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1, log⁡2n,n,nlog⁡2n,n2,n3,…,2n,n!\log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n ! -An algorithm that finds the average of n numbers by adding them and dividing by n.

(Short Answer)
4.8/5
(82)

In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1, log⁡2n,n,nlog⁡2n,n2,n3,…,2n,n!\log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n ! -The worst-case analysis of a linear search of a list of size n (counting the number of comparisons).

(Short Answer)
4.9/5
(95)

Suppose you have two different algorithms for solving a problem. To solve a problem of size n,n _ { , } the first algorithm uses exactly nnn \sqrt { n } operations and the second algorithm uses exactly n2n ^ { 2 } log nn operations. As nn grows, which algorithm uses fewer operations?

(Short Answer)
4.8/5
(91)

Arrange the following functions in a list so each is big- OO of the next one in the list: n3+88n2+3,log⁡n4,3nn ^ { 3 } + 88 n ^ { 2 } + 3 , \log n ^ { 4 } , 3 ^ { n } n2log⁡n,n⋅2n,10000n ^ { 2 } \log n , n \cdot 2 ^ { n } , 10000

(Short Answer)
4.8/5
(78)

Show that ∑j=1n(j3+j) is O(n4)\sum _ { j = 1 } ^ { n } \left( j ^ { 3 } + j \right) \text { is } O \left( n ^ { 4 } \right)

(Essay)
4.8/5
(70)

Describe an algorithm that takes a list of n integers a1, a2, . . . , an and finds the number of integers each greater than five in the list.

(Short Answer)
4.7/5
(72)

In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1, log⁡2n,n,nlog⁡2n,n2,n3,…,2n,n!\log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n ! -An algorithm that prints all bit strings of length n.

(Short Answer)
4.9/5
(70)

In questions find the best big-O function for the function. Choose your answer from among the following: 1, log⁡2n,n,nlog⁡2n,n2,n3,…,2n,n!\log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n ! - ⌈n+2⌉⋅⌈n/3⌉\lceil n + 2 \rceil \cdot \lceil n / 3 \rceil

(Short Answer)
4.7/5
(90)

In questions find the best big-O function for the function. Choose your answer from among the following: 1, log⁡2n,n,nlog⁡2n,n2,n3,…,2n,n!\log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n ! - 3−2n4−4n2n3−3n\frac { 3 - 2 n ^ { 4 } - 4 n } { 2 n ^ { 3 } - 3 n }

(Short Answer)
4.8/5
(82)

In questions find the best big-O function for the function. Choose your answer from among the following: 1, log⁡2n,n,nlog⁡2n,n2,n3,…,2n,n!\log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n ! - f(n)=1+2+3+⋯+(n2−1)+n2f ( n ) = 1 + 2 + 3 + \cdots + \left( n ^ { 2 } - 1 \right) + n ^ { 2 }

(Short Answer)
4.8/5
(89)
Showing 21 - 40 of 52
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)