• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 5 pages
Exam (elaborations)

AlgDes Ch02: Algorithm Analysis Questions With Answers

Document preview thumbnail
Preview 2 out of 5 pages

AlgDes Ch02: Algorithm Analysis Questions With Answers

Content preview

AlgDes Ch02: Algorithm Analysis Questions With
Answers
Question 1.
What are the 2 most important tools for comparing the efficiency of algorithms without
implementing them?
Correct Answer: (1) The Random Access Machine (RAM) model of computation,
and (2) the asymptotic analysis of worst-case complexity.

Question 2.
Describe the Random Access Machine model.
Correct Answer: Each simple operation and each memory access take exactly
one time step. Loops and subroutines are not considered simple operations. We
have as much memory and the model doesn't take notice of whether an item is
in cache or on the disk.

Question 3.
What additional assumption allows running times to be computed using the RAM model?
Correct Answer: That the RAM executes a constant number of steps per second.

Question 4.
What are 3 benefits of using the RAM model?
Correct Answer: 1) It allows algorithms to be understood, studied, and
compared in a language-and machine-independent (but not
implementation-independent) manner; 2) it is simple to work with, and 3)
almost never gives misleading results.

Question 5.
What are the 3 algorithm complexity functions and how are they defined?
Correct Answer: (1) Worst-case complexity is defined as the maximum number
of steps performed by the algorithm, taken over all possible input instances for
a given instance size; (2) Best-case complexity is defined as the minimum
number of steps performed by the algorithm, taken over all possible input
instances for a given instance size; and (3) Average-case complexity is defined
as the average number of steps performed by the algorithm, taken over all
possible input instances for a given instance size.

Question 6.
Which of the 3 algorithm complexity functions is most commonly used, and why?
Correct Answer: Worst-case complexity, mostly because of the ambiguities in
working with Average-case complexity. In particular, it is usually difficult to
determine how "average" a particular instance is beforehand, and it may not be
obvious what sorts of instances produce near-worst-case performance.

,Question 7.
What are 2 reasons why it is very difficult to work with the exact algorithm complexity
functions?
Correct Answer: (1) They have too many bumps, and (2) They require too much
detail to specify precisely (becomes implementation-specific, and provides very
little additional information).

Question 8.
What is 1 reason why multiplicative constants are ignored using Big Oh analysis?
Correct Answer: They are language- and machine-dependent.

Question 9.
What is the exact definition of f(n) = O(g(n))?
Correct Answer: c times g(n) is an upper bound on f(n). Thus there exists some
constant c such that f(n) is always <= c times g(n), for large enough n. I.e., for
big enough problems, there is a constant c such that f(n) is always less than c
times g(n).

Question 10.
What is the exact definition of f(n) = Omega(g(n))?
Correct Answer: c times g(n) is a lower bound on f(n). Thus there exists some
constant c such that f(n) is always >= c times g(n), for large enough n. I.e., for
big enough problems, there is a constant c such that f(n) is always greater than
c times g(n).

Question 11.
What is the exact definition of f(n) = Theta(g(n))?
Correct Answer: It's basically a combination of both O and Omega, meaning
that two different multiplicative constants of g(n) provide upper and lower
bounds of f(n) above a certain problem size. So g(n) provides a nice, tight
bound on f(n).

Question 12.
What's the take home lesson regarding Big Oh notation?
Correct Answer: The Big Oh notation and worst-case analysis are tools that
greatly simplify our ability to compare the efficiency of algorithms. The enable
us to ignore the details and focus on the big picture.

Question 13.
n^2 = O(n^3). What is a better way to read the "=" in this case?
Correct Answer: "... one of the functions that are..."

Question 14.
Why is 2^(n+1) = Theta(2^n)?
Correct Answer: The key observation is that 2^(n+1) = 2 times 2^n. So it
doesn't grow faster than 2^n, but instead is always double. I think the mistake
is picturing 2^n in a similar way to how we think of x^n. In the former, n is the
variable. In the latter, n is fixed.

Document information

Uploaded on
December 3, 2026
Number of pages
5
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$14.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Favorgrades
3.8
(200)
Sold
863
Followers
376
Items
62409
Last sold
4 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions