stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
APCSP-Algorithms Flashcards | StudBud
Explore
/
APCSP-Algorithms
APCSP-Algorithms
17 terms
·
StudBud Administration
·
1,475 plays
Quiz on Algorithms and Coding Logic (Photo by Markus Spiske on unsplash.com)
Flashcards
17 cards
F
Practice quiz
P
Host live
L
Questions
17
Answers
1
What structure must be added to the original algorithm so that it can compute the calories for multiple dogs?
Sequencing
None of the Above
Selection
Iteration
2
Is this analogous to parallel computing?
True
False
3
What does this chart demonstrate about the benefits of distributed computing?
Distributed computing utilizes all the power of a computer's processors
Distributed computing can solve large problems quickly by using heuristics
Distributed computing increases storage space available to solve problems
Distributed computing can reduce the time it takes to solve large problems
4
Which change will reduce the most number of operations while still outputting a correct answer?
Removing the updating of ind entirely
Moving the return statement inside the conditional (after PercentGreater)
Moving the calc of percentGreater after the loop (but before the return)
Moving calc of percentGreater after conditional (but before ind)
5
Which of these is a good argument for expressing the algorithm in Python on the blog?
Python code can be understood by anyone reading the article
Only Python code can express algorithms on social media data
All computers come with built-in support for Python, so the code will run
Python runs on any computer that has a Python interpreter,others can try it
6
Can the run time of the 60-min playlist feature be improved?
No, combinatorially hard problems always require superpolynomial time
No, combinatorial problems like this are considered undecidable
They can speed up run time using a heuristic for sub-optimal playlist
Yes, they can reduce the run time by rewriting the feature in fewer lines
7
If the store calls the procedure on a list of 5 products, approximately how long will it take the algorithm to complete?
2 minutes
10 minutes
20 minutes
5 minutes
8
Which of these correctly expresses that algorithm in pseudocode?
n ← 1 | REPEAT 10 TIMES { result ← n*n | DISPLAY(result) | n ← 2 }
n ← 1 | REPEAT 10 TIMES { result ← n*n | DISPLAY(result) | n ← n+2 }
n ← 1 | REPEAT 10 TIMES { result ← n*2 | DISPLAY(result) | n ← n+2 }
n ← 1 | REPEAT 10 TIMES { result ← n*n | DISPLAY(n) | n ← n+2 }
9
Based on the table, we can say the run time for this algorithm is in polynomial time and is reasonable.
True
False
10
An algorithm that uses a heuristic will come up with the
optimal
solution more quickly than an algorithm that does not.
True
False
11
Your algorithm counts the number of words in an essay. Now it must ignore words like "the" and "to". What would you use?
Selection
Iteration
Sequencing
None of the above
12
In this case, what does a speedup of 3 indicate?
The program completed in 3 minutes less time with 6 computers versus one
The program completed in 3 minutes more time with the 6 computers
The program took 3 times as long to complete with 6 computers
The program completed in 1/3 of the time with 6 computers
13
Following the algorithm below, how would you transform the word "avocado"?
abvobcabdob
abavobocabadobo
avabocabadabo
abavbvobocbcabadbdobo
14
What is the speedup of the parallel solution?
60
1/5
15
5
15
Which algorithm's runtime is most likely to be improved by the use of a heuristic?
Suggesting the grocery store that is the closest distance to the user
Calculating the final cost of the groceries plus tip and delivery fee
Sorting grocery options from lowest price to highest price for a shopper
Calculating fast route for grocery delivery driver to different customers
16
What are the implications of this problem being undecidable?
Problem may be solvable in some cases, but no algorithm solves all cases.
Problem is solvable, but will take an unreasonable amount of time.
Problem can be solved easier with a heuristic to approximate a solution.
Problem is not solvable in any cases.
17
What would be displayed as a result of executing this flowchart algorithm?
15
10
0
4 3 2 1