One day, your niece comes to visit you with a worried look on her face
Ask Expert

Be Prepared For The Toughest Questions

Practice Problems

One day, your niece comes to visit you with a worried look on her face

Part I: Fundamental

Problem 1 Saving the niece.

One day, your niece comes to visit you with a worried look on her face. It turns out that her teacher just gave a very tricky problem as part of their VCE Algorithmics Unit 3. She has spent 3 days working on it without any success. As a loving (and very capable) uncle/aunt, you must help her out. Here is the problem.

Consider the algorithm mystery() whose input is an integer array A of size n.


a) What does the algorithm compute? Justify your answer.

b) What is the algorithmic paradigm the algorithm belongs to?

c) Write the recurrence relation (formula + base condition) for C(n), which counts the number of array elements comparisons.

d) Solve the recurrence relation by the backward substitution method to obtain an explicit formula for C(n) in n.

e) Write the complexity class that C(n) belongs to using the Big-Θ notation.


Table 1: A toy example of five transactions with their corresponding sizes and fees.

Hint
ComputerThe "Divide & Conquer" computational paradigm is based on the Binary Search Algorithm. The best way to understand how “Divide and Conquer” works is to look at this algorithm. Searching may be done in O(log(n)) time with this technique, whereas linear search requires O(n) time in the worst case. ...

Know the process

Students succeed in their courses by connecting and communicating with
an expert until they receive help on their questions

1
img

Submit Question

Post project within your desired price and deadline.

2
img

Tutor Is Assigned

A quality expert with the ability to solve your project will be assigned.

3
img

Receive Help

Check order history for updates. An email as a notification will be sent.

img
Unable to find what you’re looking for?

Consult our trusted tutors.

Developed by Versioning Solutions.