Big-Oh Analysis Lab
Categories:
3 minute read
Introduction
Practice the computation of from source code.
Problem 1
To determine the number of steps, count all assignments to sum.
Answer these questions:
- Is there a different between worse-case and every-case?
- State the exact growth function
- proof its membership into its complexity class.
Problem 2
To determine the number of steps, count all assignments to sum.
Answer these questions:
- Is there a different between worse-case and every-case?
- State the exact growth function
- proof its membership into its complexity class.
Problem 3
To determine the number of steps, count all assignments to s.
Answer these questions:
- Is there a different between worse-case and every-case?
- How should the input size be represented?
- State the exact growth function
- proof its membership into its complexity class.
Problem 4
Consider the following code:
Answer the following questions:
- State what is an appropriate basic operation that you will be using to count the number of steps.
- State the exact growth function
- proof its membership into its complexity class.
Problem 5
Use incrementing sum as the basic operation. For the sake of simplicity, you may assume that the length of numbers is a power of 2.
Answer the following questions:
- Is there a different between worse-case and every-case?
- State the exact growth function
- proof its membership into its complexity class.
Problem 6
Answer the following questions:
- Is there a different between worse-case and every-case?
- State the exact growth function
- proof its membership into its complexity class.
Lab Submission
If you are in class, there is nothing to submit (its a participation grade). If you are not in class, you must submit a scanned sheet with the answers to the 6 questions by the due date.