Exam 3: Algorithms

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

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

(Short Answer)
5.0/5
(30)

In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1, log2n,n,nlog2n,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/2n : = \lfloor n / 2 \rfloor

(Short Answer)
4.8/5
(43)

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
(36)

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

(Short Answer)
4.8/5
(37)

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
(40)

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

(Essay)
4.9/5
(36)

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
(27)

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
(27)

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)
4.9/5
(28)

In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1, log2n,n,nlog2n,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.7/5
(34)

In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1, log2n,n,nlog2n,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
(36)

In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1, log2n,n,nlog2n,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
(44)

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
(36)

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

(Short Answer)
4.9/5
(35)

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.7/5
(30)

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
(31)

In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1, log2n,n,nlog2n,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
(31)

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

(Short Answer)
4.7/5
(37)

In questions find the best big-O function for the function. Choose your answer from among the following: 1, log2n,n,nlog2n,n2,n3,,2n,n!\log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n ! - 32n44n2n33n\frac { 3 - 2 n ^ { 4 } - 4 n } { 2 n ^ { 3 } - 3 n }

(Short Answer)
4.8/5
(33)

In questions find the best big-O function for the function. Choose your answer from among the following: 1, log2n,n,nlog2n,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++(n21)+n2f ( n ) = 1 + 2 + 3 + \cdots + \left( n ^ { 2 } - 1 \right) + n ^ { 2 }

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

Filters

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