100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

EECS 281: Midterm || with Actual Answers.

Rating
-
Sold
-
Pages
8
Grade
A+
Uploaded on
19-11-2025
Written in
2025/2026

EECS 281: Midterm || with Actual Answers.

Institution
EECS
Course
EECS









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
EECS
Course
EECS

Document information

Uploaded on
November 19, 2025
Number of pages
8
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

EECS 281: Midterm || with Actual Answers.
things that affect runtime correct answers the algorithm, implementation details,
CPU/memory speed, compiler (-g3 / -O3), other programs running in parallel, input size

things that affect rate of runtime growth correct answers primarily input size. Independent of
most other factors.

things that count as "one step" in a program correct answers variable assignment, arithmetic
operation, comparison, array indexing, pointer reference, function call (excluding data),
function return (excluding data)

steps taken during execution of a loop that executes n times correct answers 1 for
initialization, n + 1 for test, n for update, plus contents of loop

Big-O definition correct answers f(n) = O(g(n)) iff there are constants c > 0 and n0 > 0 such
that f(n) <= c * g(n) whenever n >= n0. Defines asymptotic upper bound.

Rules of thumb when determining if Big-O correct answers lower order terms can be ignored,
coefficient of the highest-order term can be ignored

Big-O sufficient correct answers if [(lim n -> infinity) (f(n) / g(n)) = d < infinity], then f(n) =
O(g(n)).

Big-Theta correct answers Defines asymptotic tight bound.

Big-Omega correct answers f(n) = [omega](g(n)) iff there are constants c > 0 and n0 > 0 such
that f(n) >= c * g(n) whenever n >= n0. Defines asymptotic upper bound.

Best-case performance correct answers when program executes the least number of steps,
given ideal input. (Example: data is found in the first place you look). Analysis performed
over inputs of a given size.

Worst-case performance correct answers when program executes the most number of steps,
given ideal input. (Example: data is found in the land place you could possibly look) Analysis
performed over inputs of a given size.

Average-case performance correct answers when program executes the average number of
steps required, given any input.

amortized complexity correct answers alternative way to measure the cost of an operation.
Excess steps from expensive operations averaged out over the cheap operations; total cost is
essentially constant.

analytical method to measure complexity correct answers involves analysis of the code itself
and recognizing common algorithms and patterns Based on a recurrence relation

empirical method to measure complexity correct answers involves measuring runtime
programmatically / using external tools (e.g. C++ timers). Tests are run on inputs of a variety
of sizes

, profiling tool correct answers a tool which measures where a program spends its time (e.g.
perf)

explanations if empirical results for runtime are worse than predictions correct answers error
in complexity analysis, error in implementation (e.g. extra loop, unintended operations)

explanations if empirical results for runtime are better than predictions correct answers
experiment may not have fit worse case scenario, error in complexity analysis, error in
analytical measurements, incomplete algorithm implementation, algorithm implemented is
better than one analyzed

explanations if empirical results for runtime matches asymptotic prediction but runs too slow
correct answers performance bug, -O3 not used, more optimizations needed to improve the
constant factor

recurrence relation correct answers describes the way a problem depends on a subproblem.
We can write for a computation, or for the time taken.

substitution method for solving recurrences correct answers 1. Write out T(n) = ... + T (n - 1)
+ ... + T (n - 2) + ...
2. Substitute T(n-1), T(n-2) with equation for T(n)
3. Look for a pattern
4. Use a summation formula

makefile correct answers a file that specifies at set of compilation rules that makes compiling
a lot easier

valgrind correct answers a tool that is used to detect undefined behaviors (e.g. use of
uninitialized values, out-of-bounds reads, out-of-bounds writes, memory leaks)

getopt_long correct answers a function that is used to automate command line parsing

vec.resize(new_size) correct answers changes size of a vector, and it's capacity if needed

vec.reserve(new_capacity) correct answers changes capacity of a vector

behavior of vec.push_back(val) when size exceeds capacity correct answers all existing
values are copied to vector of twice the capacity, original vector is deleted

behavior of program stack when function call is made correct answers all local variables are
saved on stack, and argument values are pushed onto the stack

behavior of program stack when function call is received correct answers function arguments
are popped off the stack

behavior of program stack when return is issued within the function correct answers the
return value is pushed to the program stack

Get to know the seller

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.
FullyFocus NURSING, ECONOMICS, MATHEMATICS, BIOLOGY, AND HISTORY MATERIALS BEST TUTORING, HOMEWORK HELP, EXAMS, TESTS, AND STUDY GUIDE MATERIALS WITH GUARANTEED A+ I am a dedicated medical practitioner with diverse knowledge in matters
View profile
Follow You need to be logged in order to follow users or courses
Sold
734
Member since
3 year
Number of followers
437
Documents
34567
Last sold
1 week ago
Reign Supreme Scholarly || Enlightened.

Here we offer revised study materials to elevate your educational outcomes. We have verified learning materials (Research, Exams Questions and answers, Assignments, notes etc) for different courses guaranteed to boost your academic results. We are dedicated to offering you the best services and you are encouraged to inquire further assistance from our end if need be. Having a wide knowledge in Nursing, trust us to take care of your Academic materials and your remaining duty will just be to Excel. Remember to give us a review, it is key for us to understand our clients satisfaction. We highly appreciate clients who always come back for more of the study content we offer, you are extremely valued. All the best.

Read more Read less
3.7

110 reviews

5
46
4
20
3
22
2
8
1
14

Recently viewed by you

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

Frequently asked questions