Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Mathematics
Study Set
Discrete Mathematics and Its Applications Study Set 1
Quiz 3: A: Algorithms
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Question 41
Short Answer
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 A
1
, A
2
, A
3
of sizes 10 × 50, 50 × 10, 10 × 40?
Question 42
Short Answer
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
,
…
,
2
n
,
n
!
1 , \log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n !
1
,
lo
g
2
n
,
n
,
n
lo
g
2
n
,
n
2
,
n
3
,
…
,
2
n
,
n
!
-The best-case analysis of a linear search of a list of size n (counting the number of comparisons)
Question 43
Short Answer
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
,
…
,
2
n
,
n
!
1 , \log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n !
1
,
lo
g
2
n
,
n
,
n
lo
g
2
n
,
n
2
,
n
3
,
…
,
2
n
,
n
!
-An iterative algorithm to compute n!, (counting the number of multiplications)
Question 44
Short Answer
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
,
…
,
2
n
,
n
!
1 , \log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n !
1
,
lo
g
2
n
,
n
,
n
lo
g
2
n
,
n
2
,
n
3
,
…
,
2
n
,
n
!
-An algorithm that finds the average of n numbers by adding them and dividing by n
Question 45
Short Answer
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
,
…
,
2
n
,
n
!
1 , \log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n !
1
,
lo
g
2
n
,
n
,
n
lo
g
2
n
,
n
2
,
n
3
,
…
,
2
n
,
n
!
-The number of print statements in the following:
Question 46
Short Answer
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 A
1
, A
2
, A
3
of sizes 20 × 5, 5 × 50, 50 × 5?
Question 47
Short Answer
Give a big-O estimate for the number of operations (where an operation is an addition or a multiplication) used in this segment of an algorithm:
Question 48
Short Answer
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
,
…
,
2
n
,
n
!
1 , \log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n !
1
,
lo
g
2
n
,
n
,
n
lo
g
2
n
,
n
2
,
n
3
,
…
,
2
n
,
n
!
-The worst-case analysis of a linear search of a list of size n (counting the number of comparisons)
Question 49
Short Answer
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
,
…
,
2
n
,
n
!
1 , \log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n !
1
,
lo
g
2
n
,
n
,
n
lo
g
2
n
,
n
2
,
n
3
,
…
,
2
n
,
n
!
-An algorithm that prints all bit strings of length n.
Question 50
Essay
assume that the number of multiplications of entries used to multiply a p × q and a q × r matrix is pqr. -What is the best order to form the product ABC if A, B and C are matrices with dimensions 8 × 3, 3 × 6 and 6 × 12, respectively?
Question 51
Short Answer
Give a big-O estimate for the number of operations (where an operation is an addition or a multiplication) used in this segment of an algorithm:
Question 52
Short Answer
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
,
…
,
2
n
,
n
!
1 , \log _ { 2 } n , n , n \log _ { 2 } n , n ^ { 2 } , n ^ { 3 } , \ldots , 2 ^ { n } , n !
1
,
lo
g
2
n
,
n
,
n
lo
g
2
n
,
n
2
,
n
3
,
…
,
2
n
,
n
!
-An algorithm that prints all subsets of size three of the set {1, 2, 3, . . . , n}
Question 53
Essay
assume that the number of multiplications of entries used to multiply a p × q and a q × r matrix is pqr. -What is the best order to form the product ABC if A, B and C are matrices with dimensions 2 × 5, 5 × 7 and 7 × 3, respectively?