Exam 3: A: Algorithms

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

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

(Short Answer)
4.9/5
(39)

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

(Short Answer)
4.9/5
(30)

Use the definition of big-O to prove that 6n+4n547n23 is O(n3)\frac { 6 n + 4 n ^ { 5 } - 4 } { 7 n ^ { 2 } - 3 } \text { is } O \left( n ^ { 3 } \right)

(Short Answer)
4.9/5
(18)

Arrange the following functions in a list so each is big-O of the next one in the list: logn2,loglogn,nlogn\log n ^ { 2 } , \log \log n , n \log n log(n2+1),log2n\log \left( n ^ { 2 } + 1 \right) , \log 2 ^ { n }

(Short Answer)
4.7/5
(35)

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

(Short Answer)
4.9/5
(25)

Describe an algorithm that takes a list of integers a1, a2, . . . , an Describe an algorithm that takes a list of integers a<sub>1</sub>, a<sub>2</sub>, . . . , a<sub>n</sub>    and finds the second-largest integer in the sequence by going through the list and keeping track of the largest and second-largest integer encountered. and finds the second-largest integer in the sequence by going through the list and keeping track of the largest and second-largest integer encountered.

(Essay)
4.8/5
(35)

find the best big-O function for the function. Choose your answer from among the following:  1, log2n,n,nlog2n,n2,n3,,2n,n!\text { 1, } \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)
5.0/5
(39)

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!1 , \log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n ! -A linear search to find the smallest number in a list of n numbers.

(Short Answer)
4.9/5
(41)

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!1 , \log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n ! -An algorithm that lists all ways to put the numbers 1, 2, 3, . . . , n in a row.

(Short Answer)
4.9/5
(39)

Describe in words how the binary search works.

(Essay)
4.8/5
(38)

find the best big-O function for the function. Choose your answer from among the following:  1, log2n,n,nlog2n,n2,n3,,2n,n!\text { 1, } \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
(33)

Express a brute-force algorithm that finds the second largest element in a list a1, a2, . . . , an (n2)( n \geq 2 ) of distinct integers by finding the largest element, placing it at the beginning of the sequence, then finding the largest element of the remaining sequence.

(Essay)
4.7/5
(33)

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!1 , \log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n ! -The number of print statements in the following:  find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following:  1 , \log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n !  -The number of print statements in the following:

(Short Answer)
4.8/5
(37)

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

(Short Answer)
4.8/5
(45)

Find the best big-O function for x3+7x3x+1\frac { x ^ { 3 } + 7 x } { 3 x + 1 }

(Short Answer)
4.9/5
(46)

Show that f(x)=(x+2)log2(x2+1)+log2(x3+1) is O(xlog2x)f ( x ) = ( x + 2 ) \log _ { 2 } \left( x ^ { 2 } + 1 \right) + \log _ { 2 } \left( x ^ { 3 } + 1 \right) \text { is } O \left( x \log _ { 2 } x \right)

(Short Answer)
4.8/5
(33)

Find all pairs of functions in this list that are of the same order: n2+logn,2n+3n,100n3+n2,n2+2nn ^ { 2 } + \log n , 2 ^ { n } + 3 ^ { n } , 100 n ^ { 3 } + n ^ { 2 } , n ^ { 2 } + 2 ^ { n } n2+n3,3n3+2nn ^ { 2 } + n ^ { 3 } , 3 n ^ { 3 } + 2 ^ { n }

(Short Answer)
4.9/5
(31)

Prove or disprove that the cashier's algorithm for making change always uses the fewest coins possible when the denominations available are pennies (1-cent coins), nickels (5-cent coins), and quarters (25-cent coins).

(True/False)
4.9/5
(27)

find the best big-O function for the function. Choose your answer from among the following:  1, log2n,n,nlog2n,n2,n3,,2n,n!\text { 1, } \log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n ! - g(n)=1+3+5+7++(2n1)g ( n ) = 1 + 3 + 5 + 7 + \cdots + ( 2 n - 1 )

(Short Answer)
4.8/5
(25)

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 20 × 5, 5 × 50, 50 × 5?

(Short Answer)
4.9/5
(40)
Showing 21 - 40 of 54
close modal

Filters

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