Instructions According to our suggested 16 week “Course Schedule,” you should complete and

Instructions According to our suggested 16 week “Course Schedule,” you should complete and

 

Assignment 2

Instructions

According to our suggested 16 week “Course Schedule,” you should complete and submit Assignment 2 by the Sunday at the end of Week 6. This assignment is worth 10% of your final grade. To receive full marks, answer each of the following questions in a clear and comprehensive manner. You can find the assignment marking criteria at the end of this document.

Questions

1.  Show that if f(n) is O(h(n)) and g(n) is O(i(n)), then f(n) + g(n) is O(h(n) + i(n)).

[2 marks]

2. Show that 3(+ 1)7 + 2log is O(n7). Hint: Try applying the rules of Theorem 1.7. You will have to use the insert equations to answer this question. [2 marks]

3. Give an O(n)-time algorithm for computing the depth of each node of a tree T, where is the number of nodes of T. Assume the existence of methods setDepth (v,d) and getDepth(v) that run in O(1) time.  [2 marks]

4. What does the following algorithm do? Analyze its worst-case running time and express it using “Big-Oh” notation. [2 marks]

Algorithm Foo (a,n):

Input: two integers, a and n

Output: ?

k ß 0

b ß 1

while k < n do

k ßk + 1

b  ß b *a

return b

 

5. a. Describe (in pseudo-code) a findAll Elements (k) method of an AVL tree T. It should run in O(logn + s) time where n is the size of T and s is the number of elements returned (i.e., the number of nodes in T whose key is k).

b. Analyze the running time of your algorithm.

[2 marks]

 

Marking Criteria for Assignments

 

You will be awarded full marks if your   answer adequately answers the question addressed.

Total marks = 10

You will be awarded partial marks if your   answer demonstrates:

· Application of the major and   alternative approaches, methods, or algorithms to solve the problem.

· Evidence of appropriate   logic.

· Evidence of correct   computational skills and data structures.

· Inclusion of appropriate   comments or explanations.

For details about how to submit this assignment, refer to the “Assignment Submission Instructions” under the Assignments Overview tab of your course.

"96% of our customers have reported a 90% and above score. You might want to place an order with us."

Essay Writing Service
Affordable prices

You might be focused on looking for a cheap essay writing service instead of searching for the perfect combination of quality and affordable rates. You need to be aware that a cheap essay does not mean a good essay, as qualified authors estimate their knowledge realistically. At the same time, it is all about balance. We are proud to offer rates among the best on the market and believe every student must have access to effective writing assistance for a cost that he or she finds affordable.

Caring support 24/7

If you need a cheap paper writing service, note that we combine affordable rates with excellent customer support. Our experienced support managers professionally resolve issues that might appear during your collaboration with our service. Apply to them with questions about orders, rates, payments, and more. Contact our managers via our website or email.

Non-plagiarized papers

“Please, write my paper, making it 100% unique.” We understand how vital it is for students to be sure their paper is original and written from scratch. To us, the reputation of a reliable service that offers non-plagiarized texts is vital. We stop collaborating with authors who get caught in plagiarism to avoid confusion. Besides, our customers’ satisfaction rate says it all.

© 2022 Homeworkcrew.com provides writing and research services for limited use only. All the materials from our website should be used with proper references and in accordance with Terms & Conditions.

Scroll to Top