100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
UCCC 2063 Algorithm Analysis Midterm with answer (UTAR) $20.99   Add to cart

Exam (elaborations)

UCCC 2063 Algorithm Analysis Midterm with answer (UTAR)

 2 views  0 purchase
  • Course
  • Institution

UCCC 2063 Algorithm Analysis Midterm with answer (UTAR) True/False: Is 2^(n+1) = O(2^n) ? - ANSWER>>False 3^n + 12 - ANSWER>>O(2^n) What is the Asymptotic complexity of a binary search given the code below and the following recursion equation: T(n) = T(n/2) + 1 ...

[Show more]

Preview 2 out of 11  pages

  • August 19, 2024
  • 11
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
avatar-seller
UCCC 2063 Algorithm Analysis Midterm
with answer (UTAR)



True/False: Is 2^(n+1) = O(2^n) ? - ANSWER>>False

3^n + 12 - ANSWER>>O(2^n)

What is the Asymptotic complexity of a binary search given the code below and
the following recursion equation:

T(n) = T(n/2) + 1

// initially called with low = 0, high = N - 1
BinarySearch_Right(A[0..N-1], value, low, high) {
// invariants: value >= A[i] for all i < low
value < A[i] for all i > high
if (high < low)
return low
mid = (low + high) / 2
if (A[mid] > value)
return BinarySearch_Right(A, value, low, mid-1)
else
return BinarySearch_Right(A, value, mid+1, high)
} - ANSWER>>O(lg * n)

Given the following algorithm, what is the number of fundamental instructions that
this routine will execute if the value of n is 4?

var M = A[ 0 ];
for ( var i = 0; i < n; ++i ) {
if ( A[ i ] >= M ) {

, M = A[ i ];
}
} - ANSWER>>4+2n

True/False: A Boolean variable can take on only 1 value. - ANSWER>>False

Which of the following is NOT a property of logarithms?

a. log(nm) = log n + log m
b. log(n/m) = log n - log m
c. log (n^r)= r log n
d. log(b) n= log(n)b log(a)b - ANSWER>>d

True/False: An algorithm is a well-defined sequence of steps used to solve a well-
defined problem in finite time. - ANSWER>>True

True/False: The running time of an algorithm is the number of instructions it
executes when run on a particular instance. - ANSWER>>True

True/False: An algorithm is a well-defined sequence of steps used to solve a well-
defined problem in an infinite number of steps. - ANSWER>>False

True/False: The backtracking algorithm treats the solution space as a graph and
follows a path to conclusion to find a solution to a problem. The algorithm may
'backtrack' by reversing up to previous branches in a tree and try all branches to
find the solution. - ANSWER>>True

The Backtracking algorithm implements what search?

a. Depth First Search
b. Sequential search
c. Breadth First Search
d. Binary Search - ANSWER>>a

Which of the following is NOT one of the steps used in a Divide-and-conquer
algorithm to solve a problem?

a. Breaking the problem into subproblems that are themselves smaller instances of
the same type of problem

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller angelamakinyaa. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $20.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

77529 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$20.99
  • (0)
  Add to cart