Deck 3: Algorithms

Full screen (f)
exit full mode
Question
Use the definition of big_Use the definition of big_  to prove that   is https://d2lvgg3v3hfg70.cloudfront.net/TB34225555/ .<div style=padding-top: 35px> to prove that Use the definition of big_  to prove that   is https://d2lvgg3v3hfg70.cloudfront.net/TB34225555/ .<div style=padding-top: 35px> is https://d2lvgg3v3hfg70.cloudfront.net/TB34225555/Use the definition of big_  to prove that   is https://d2lvgg3v3hfg70.cloudfront.net/TB34225555/ .<div style=padding-top: 35px> .
Use Space or
up arrow
down arrow
to flip the card.
Question
Prove or disprove that the greedy algorithm for making change always uses the fewest coins possible when the
denominations available are 1-cent coins, 8-cent coins, and 20-cent coins.
Question
Use the definition of big-Use the definition of big-  to prove that  1.2+2.3+3.4+...+    .     is  <div style=padding-top: 35px> to prove that 1.2+2.3+3.4+...+ Use the definition of big-  to prove that  1.2+2.3+3.4+...+    .     is  <div style=padding-top: 35px> . Use the definition of big-  to prove that  1.2+2.3+3.4+...+    .     is  <div style=padding-top: 35px> is Use the definition of big-  to prove that  1.2+2.3+3.4+...+    .     is  <div style=padding-top: 35px>
Question
Use the definition of big-Use the definition of big-  to prove that   is  <div style=padding-top: 35px> to prove that Use the definition of big-  to prove that   is  <div style=padding-top: 35px> is Use the definition of big-  to prove that   is  <div style=padding-top: 35px>
Question
Describe an algorithm that takes a list of n integers (n ≥ 1) and finds the location of the last even integer in the list. and returns 0 if there aer no even integers in the list .
Question
Show how the binary search algorithm searches for 27 in the following list: 5 6 8 12 15 21 25 31.
Question
Express a brute-force algorithm that finds the second largest element in a list a1, a2, . . . , an (n ≥ 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.
Question
In questions find the best big-O function for the function. Choose your answer from among the following:
1, In questions find the best big-O function for the function. Choose your answer from among the following: 1,    <div style=padding-top: 35px>
In questions find the best big-O function for the function. Choose your answer from among the following: 1,    <div style=padding-top: 35px>
Question
Express a brute-force algorithm that finds the largest product of two numbers in a list a1, a2, . . . , an (n ≥ 2) that is less than a threshold N .
Question
Let Let    . Show that f(n) is https://d2lvgg3v3hfg70.cloudfront.net/TB5530/ .find  C and k from the definition.<div style=padding-top: 35px> . Show that f(n) is https://d2lvgg3v3hfg70.cloudfront.net/TB5530/Let    . Show that f(n) is https://d2lvgg3v3hfg70.cloudfront.net/TB5530/ .find  C and k from the definition.<div style=padding-top: 35px> .find C and k from the definition.
Question
In questions find the best big-O function for the function. Choose your answer from among the following:
1, In questions find the best big-O function for the function. Choose your answer from among the following: 1,    <div style=padding-top: 35px>
In questions find the best big-O function for the function. Choose your answer from among the following: 1,    <div style=padding-top: 35px>
Question
Describe in words how the binary search works.
Question
Describe an algorithm that takes a list of integers a1, a2, . . . , an (n ≥ 2) 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.
Question
Use the definition of big-Use the definition of big-  to prove that   is  <div style=padding-top: 35px> to prove that Use the definition of big-  to prove that   is  <div style=padding-top: 35px> is Use the definition of big-  to prove that   is  <div style=padding-top: 35px>
Question
Prove or disprove that the greedy 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).
Question
Use the definition of big-Use the definition of big-  to prove that   is  <div style=padding-top: 35px> to prove that Use the definition of big-  to prove that   is  <div style=padding-top: 35px> is Use the definition of big-  to prove that   is  <div style=padding-top: 35px>
Question
Describe an algorithm that takes a list of n integers (n ≥ 1) and finds the average of the largest and smallest integers in the list.
Question
You have supplies of boards that are one foot, five feet, seven feet, and twelve feet long. You need to lay pieces
end-to-end to make a molding 15 feet long and wish to do this using the fewest number of pieces possible.
Explain why the greedy algorithm of taking boards of the longest length at each stage (so long as the total
length of the boards selected does not exceed 15 feet) does not give the fewest number of boards possible.
Question
In questions find the best big-O function for the function. Choose your answer from among the following:
1, In questions find the best big-O function for the function. Choose your answer from among the following: 1,    <div style=padding-top: 35px>
In questions find the best big-O function for the function. Choose your answer from among the following: 1,    <div style=padding-top: 35px>
Question
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.
Question
Arrange the functions Arrange the functions   and   in a list so that each function is big-  of the next  function .<div style=padding-top: 35px> and Arrange the functions   and   in a list so that each function is big-  of the next  function .<div style=padding-top: 35px> in a list so that each function is big-Arrange the functions   and   in a list so that each function is big-  of the next  function .<div style=padding-top: 35px> of the next function .
Question
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   A binary search of n elements.<div style=padding-top: 35px>
A binary search of n elements.
Question
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   An algorithm that prints all bit strings of length n.<div style=padding-top: 35px>
An algorithm that prints all bit strings of length n.
Question
Show that Show that  <div style=padding-top: 35px>
Question
In questions find the best big-O function for the function. Choose your answer from among the following:
1, In questions find the best big-O function for the function. Choose your answer from among the following: 1,    <div style=padding-top: 35px>
In questions find the best big-O function for the function. Choose your answer from among the following: 1,    <div style=padding-top: 35px>
Question
Find the best Find the best  <div style=padding-top: 35px>
Question
Arrange the following functions in a list so each is big-Arrange the following functions in a list so each is big-  of the next one in the list:    <div style=padding-top: 35px> of the next one in the list: Arrange the following functions in a list so each is big-  of the next one in the list:    <div style=padding-top: 35px> Arrange the following functions in a list so each is big-  of the next one in the list:    <div style=padding-top: 35px>
Question
Find all pairs of functions in this list that are of the same order: Find all pairs of functions in this list that are of the same order:  ,  <div style=padding-top: 35px> , Find all pairs of functions in this list that are of the same order:  ,  <div style=padding-top: 35px>
Question
Find the Find the  <div style=padding-top: 35px>
Question
Prove that Prove that   is https://d2lvgg3v3hfg70.cloudfront.net/TB34225555/ .<div style=padding-top: 35px> is https://d2lvgg3v3hfg70.cloudfront.net/TB34225555/Prove that   is https://d2lvgg3v3hfg70.cloudfront.net/TB34225555/ .<div style=padding-top: 35px> .
Question
Show that Show that  <div style=padding-top: 35px>
Question
In questions find the best big-O function for the function. Choose your answer from among the following:
1, In questions find the best big-O function for the function. Choose your answer from among the following: 1,    <div style=padding-top: 35px>
In questions find the best big-O function for the function. Choose your answer from among the following: 1,    <div style=padding-top: 35px>
Question
Prove that Prove that  <div style=padding-top: 35px>
Question
Suppose you have two different algorithms for solving a problem. To solve a problem of size Suppose you have two different algorithms for solving a problem. To solve a problem of size   the first algorithm uses exactly   operations and the second algorithm uses exactly   log    operations. As   grows, which algorithm uses fewer operations?<div style=padding-top: 35px> the first algorithm uses exactly Suppose you have two different algorithms for solving a problem. To solve a problem of size   the first algorithm uses exactly   operations and the second algorithm uses exactly   log    operations. As   grows, which algorithm uses fewer operations?<div style=padding-top: 35px> operations and the second algorithm uses exactly Suppose you have two different algorithms for solving a problem. To solve a problem of size   the first algorithm uses exactly   operations and the second algorithm uses exactly   log    operations. As   grows, which algorithm uses fewer operations?<div style=padding-top: 35px> log Suppose you have two different algorithms for solving a problem. To solve a problem of size   the first algorithm uses exactly   operations and the second algorithm uses exactly   log    operations. As   grows, which algorithm uses fewer operations?<div style=padding-top: 35px> operations. As Suppose you have two different algorithms for solving a problem. To solve a problem of size   the first algorithm uses exactly   operations and the second algorithm uses exactly   log    operations. As   grows, which algorithm uses fewer operations?<div style=padding-top: 35px> grows, which algorithm uses fewer operations?
Question
Prove that Prove that  <div style=padding-top: 35px>
Question
Arrange the following functions in a list so each is big-Arrange the following functions in a list so each is big-  of the next one in the list:  log  , log log     log    <div style=padding-top: 35px> of the next one in the list: log Arrange the following functions in a list so each is big-  of the next one in the list:  log  , log log     log    <div style=padding-top: 35px> , log log Arrange the following functions in a list so each is big-  of the next one in the list:  log  , log log     log    <div style=padding-top: 35px> log Arrange the following functions in a list so each is big-  of the next one in the list:  log  , log log     log    <div style=padding-top: 35px> Arrange the following functions in a list so each is big-  of the next one in the list:  log  , log log     log    <div style=padding-top: 35px>
Question
In questions find the best big-O function for the function. Choose your answer from among the following:
1, In questions find the best big-O function for the function. Choose your answer from among the following: 1,    <div style=padding-top: 35px>
In questions find the best big-O function for the function. Choose your answer from among the following: 1,    <div style=padding-top: 35px>
Question
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   A linear search to find the smallest number in a list of n numbers.<div style=padding-top: 35px>
A linear search to find the smallest number in a list of n numbers.
Question
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   The number of print statements in the following:  <div style=padding-top: 35px>
The number of print statements in the following: In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   The number of print statements in the following:  <div style=padding-top: 35px>
Question
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   An algorithm that lists all ways to put the numbers 1, 2, 3, . . . , n in a row.<div style=padding-top: 35px>
An algorithm that lists all ways to put the numbers 1, 2, 3, . . . , n in a row.
Question
assume that the number of multiplications of entries used to multiply a p × q and a q × r matrix is
pqr.
Whatand 7 ×is 3,therespbestectivorderely?to form the product ABC if A, B and C are matrices with dimensions 2 × 5, 5 × 7
Question
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   An algorithm that finds the average of n numbers by adding them and dividing by n.<div style=padding-top: 35px>
An algorithm that finds the average of n numbers by adding them and dividing by n.
Question
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,    <div style=padding-top: 35px>
In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,    <div style=padding-top: 35px>
Question
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   The number of print statements in the following:  <div style=padding-top: 35px>
The number of print statements in the following: In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   The number of print statements in the following:  <div style=padding-top: 35px>
Question
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 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  <div style=padding-top: 35px>
Question
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   An algorithm that prints all subsets of size three of the set {1, 2, 3, . . . , n}.<div style=padding-top: 35px>
An algorithm that prints all subsets of size three of the set {1, 2, 3, . . . , n}.
Question
assume that the number of multiplications of entries used to multiply a p × q and a q × r matrix is
pqr.
Whatand 6 ×is 12,therespbestectivorderely?to form the product ABC if A, B and C are matrices with dimensions 8 × 3, 3 × 6
Question
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: 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:  <div style=padding-top: 35px>
Question
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 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  <div style=padding-top: 35px>
Question
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   The best-case analysis of a linear search of a list of size n (counting the number of comparisons).<div style=padding-top: 35px>
The best-case analysis of a linear search of a list of size n (counting the number of comparisons).
Question
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: 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:  <div style=padding-top: 35px>
Question
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   The worst-case analysis of a linear search of a list of size n (counting the number of comparisons).<div style=padding-top: 35px>
The worst-case analysis of a linear search of a list of size n (counting the number of comparisons).
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/52
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 3: Algorithms
1
Use the definition of big_Use the definition of big_  to prove that   is https://d2lvgg3v3hfg70.cloudfront.net/TB34225555/ . to prove that Use the definition of big_  to prove that   is https://d2lvgg3v3hfg70.cloudfront.net/TB34225555/ . is https://d2lvgg3v3hfg70.cloudfront.net/TB34225555/Use the definition of big_  to prove that   is https://d2lvgg3v3hfg70.cloudfront.net/TB34225555/ ..
2
Prove or disprove that the greedy algorithm for making change always uses the fewest coins possible when the
denominations available are 1-cent coins, 8-cent coins, and 20-cent coins.
False The algorithm gives change of 25 using 20, 1, 1, 1, 1, 1 (a total of six coins), but it can be done using
8, 8, 8, 1 (a total of only four coins).
3
Use the definition of big-Use the definition of big-  to prove that  1.2+2.3+3.4+...+    .     is  to prove that 1.2+2.3+3.4+...+ Use the definition of big-  to prove that  1.2+2.3+3.4+...+    .     is  . Use the definition of big-  to prove that  1.2+2.3+3.4+...+    .     is  is Use the definition of big-  to prove that  1.2+2.3+3.4+...+    .     is
4
Use the definition of big-Use the definition of big-  to prove that   is  to prove that Use the definition of big-  to prove that   is  is Use the definition of big-  to prove that   is
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
5
Describe an algorithm that takes a list of n integers (n ≥ 1) and finds the location of the last even integer in the list. and returns 0 if there aer no even integers in the list .
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
6
Show how the binary search algorithm searches for 27 in the following list: 5 6 8 12 15 21 25 31.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
7
Express a brute-force algorithm that finds the second largest element in a list a1, a2, . . . , an (n ≥ 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.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
8
In questions find the best big-O function for the function. Choose your answer from among the following:
1, In questions find the best big-O function for the function. Choose your answer from among the following: 1,
In questions find the best big-O function for the function. Choose your answer from among the following: 1,
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
9
Express a brute-force algorithm that finds the largest product of two numbers in a list a1, a2, . . . , an (n ≥ 2) that is less than a threshold N .
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
10
Let Let    . Show that f(n) is https://d2lvgg3v3hfg70.cloudfront.net/TB5530/ .find  C and k from the definition. . Show that f(n) is https://d2lvgg3v3hfg70.cloudfront.net/TB5530/Let    . Show that f(n) is https://d2lvgg3v3hfg70.cloudfront.net/TB5530/ .find  C and k from the definition..find C and k from the definition.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
11
In questions find the best big-O function for the function. Choose your answer from among the following:
1, In questions find the best big-O function for the function. Choose your answer from among the following: 1,
In questions find the best big-O function for the function. Choose your answer from among the following: 1,
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
12
Describe in words how the binary search works.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
13
Describe an algorithm that takes a list of integers a1, a2, . . . , an (n ≥ 2) 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.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
14
Use the definition of big-Use the definition of big-  to prove that   is  to prove that Use the definition of big-  to prove that   is  is Use the definition of big-  to prove that   is
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
15
Prove or disprove that the greedy 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).
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
16
Use the definition of big-Use the definition of big-  to prove that   is  to prove that Use the definition of big-  to prove that   is  is Use the definition of big-  to prove that   is
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
17
Describe an algorithm that takes a list of n integers (n ≥ 1) and finds the average of the largest and smallest integers in the list.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
18
You have supplies of boards that are one foot, five feet, seven feet, and twelve feet long. You need to lay pieces
end-to-end to make a molding 15 feet long and wish to do this using the fewest number of pieces possible.
Explain why the greedy algorithm of taking boards of the longest length at each stage (so long as the total
length of the boards selected does not exceed 15 feet) does not give the fewest number of boards possible.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
19
In questions find the best big-O function for the function. Choose your answer from among the following:
1, In questions find the best big-O function for the function. Choose your answer from among the following: 1,
In questions find the best big-O function for the function. Choose your answer from among the following: 1,
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
20
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.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
21
Arrange the functions Arrange the functions   and   in a list so that each function is big-  of the next  function . and Arrange the functions   and   in a list so that each function is big-  of the next  function . in a list so that each function is big-Arrange the functions   and   in a list so that each function is big-  of the next  function . of the next function .
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
22
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   A binary search of n elements.
A binary search of n elements.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
23
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   An algorithm that prints all bit strings of length n.
An algorithm that prints all bit strings of length n.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
24
Show that Show that
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
25
In questions find the best big-O function for the function. Choose your answer from among the following:
1, In questions find the best big-O function for the function. Choose your answer from among the following: 1,
In questions find the best big-O function for the function. Choose your answer from among the following: 1,
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
26
Find the best Find the best
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
27
Arrange the following functions in a list so each is big-Arrange the following functions in a list so each is big-  of the next one in the list:    of the next one in the list: Arrange the following functions in a list so each is big-  of the next one in the list:    Arrange the following functions in a list so each is big-  of the next one in the list:
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
28
Find all pairs of functions in this list that are of the same order: Find all pairs of functions in this list that are of the same order:  ,  , Find all pairs of functions in this list that are of the same order:  ,
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
29
Find the Find the
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
30
Prove that Prove that   is https://d2lvgg3v3hfg70.cloudfront.net/TB34225555/ . is https://d2lvgg3v3hfg70.cloudfront.net/TB34225555/Prove that   is https://d2lvgg3v3hfg70.cloudfront.net/TB34225555/ ..
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
31
Show that Show that
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
32
In questions find the best big-O function for the function. Choose your answer from among the following:
1, In questions find the best big-O function for the function. Choose your answer from among the following: 1,
In questions find the best big-O function for the function. Choose your answer from among the following: 1,
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
33
Prove that Prove that
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
34
Suppose you have two different algorithms for solving a problem. To solve a problem of size Suppose you have two different algorithms for solving a problem. To solve a problem of size   the first algorithm uses exactly   operations and the second algorithm uses exactly   log    operations. As   grows, which algorithm uses fewer operations? the first algorithm uses exactly Suppose you have two different algorithms for solving a problem. To solve a problem of size   the first algorithm uses exactly   operations and the second algorithm uses exactly   log    operations. As   grows, which algorithm uses fewer operations? operations and the second algorithm uses exactly Suppose you have two different algorithms for solving a problem. To solve a problem of size   the first algorithm uses exactly   operations and the second algorithm uses exactly   log    operations. As   grows, which algorithm uses fewer operations? log Suppose you have two different algorithms for solving a problem. To solve a problem of size   the first algorithm uses exactly   operations and the second algorithm uses exactly   log    operations. As   grows, which algorithm uses fewer operations? operations. As Suppose you have two different algorithms for solving a problem. To solve a problem of size   the first algorithm uses exactly   operations and the second algorithm uses exactly   log    operations. As   grows, which algorithm uses fewer operations? grows, which algorithm uses fewer operations?
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
35
Prove that Prove that
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
36
Arrange the following functions in a list so each is big-Arrange the following functions in a list so each is big-  of the next one in the list:  log  , log log     log    of the next one in the list: log Arrange the following functions in a list so each is big-  of the next one in the list:  log  , log log     log    , log log Arrange the following functions in a list so each is big-  of the next one in the list:  log  , log log     log    log Arrange the following functions in a list so each is big-  of the next one in the list:  log  , log log     log    Arrange the following functions in a list so each is big-  of the next one in the list:  log  , log log     log
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
37
In questions find the best big-O function for the function. Choose your answer from among the following:
1, In questions find the best big-O function for the function. Choose your answer from among the following: 1,
In questions find the best big-O function for the function. Choose your answer from among the following: 1,
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
38
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   A linear search to find the smallest number in a list of n numbers.
A linear search to find the smallest number in a list of n numbers.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
39
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   The number of print statements in the following:
The number of print statements in the following: In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   The number of print statements in the following:
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
40
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   An algorithm that lists all ways to put the numbers 1, 2, 3, . . . , n in a row.
An algorithm that lists all ways to put the numbers 1, 2, 3, . . . , n in a row.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
41
assume that the number of multiplications of entries used to multiply a p × q and a q × r matrix is
pqr.
Whatand 7 ×is 3,therespbestectivorderely?to form the product ABC if A, B and C are matrices with dimensions 2 × 5, 5 × 7
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
42
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   An algorithm that finds the average of n numbers by adding them and dividing by n.
An algorithm that finds the average of n numbers by adding them and dividing by n.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
43
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,
In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
44
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   The number of print statements in the following:
The number of print statements in the following: In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   The number of print statements in the following:
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
45
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 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
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
46
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   An algorithm that prints all subsets of size three of the set {1, 2, 3, . . . , n}.
An algorithm that prints all subsets of size three of the set {1, 2, 3, . . . , n}.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
47
assume that the number of multiplications of entries used to multiply a p × q and a q × r matrix is
pqr.
Whatand 6 ×is 12,therespbestectivorderely?to form the product ABC if A, B and C are matrices with dimensions 8 × 3, 3 × 6
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
48
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: 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:
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
49
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 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
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
50
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   The best-case analysis of a linear search of a list of size n (counting the number of comparisons).
The best-case analysis of a linear search of a list of size n (counting the number of comparisons).
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
51
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: 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:
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
52
In questions find the "best" big-O notation to describe the complexity of the algorithm. Choose your
answers from the following:
1, In questions find the best big-O notation to describe the complexity of the algorithm. Choose your answers from the following: 1,   The worst-case analysis of a linear search of a list of size n (counting the number of comparisons).
The worst-case analysis of a linear search of a list of size n (counting the number of comparisons).
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 52 flashcards in this deck.