[SOLVED] CSC4520 Assignment 2

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Assign2-pd2m9p.zip (1294.4 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
πŸ”’ Securely Powered by:
Secure Checkout
5/5 - (1 vote)

1.Β  Using Figure 6.4 (Textbook, Exercise 6.4-1) as a model, illustrate the operation of HEAPSORT on the array A={5, 12, 2, 25, 7, 17, 20, 8, 14} and output the numbers in a non-decreasing order. (Write your result of each step.)

2. Max-Min Problem: find the maximum and the minimum numbers of a sequence number in a divide-and-conquer manner. (Let 𝑛 be the size of the sequence. For simplicity, assume that 𝑛 = 2!.)

(1) How to do it? Please write the pseudo-code of your algorithm.

(2)Β  What is time complexity of your algorithm? Please present analysis process.

3.Β  Give asymptotic upper bound (represented by O( )) of the recursive function T(n) = T(n-2) + n. Assume that T(n) is constant for nΒ£2.

1

  • Assign2-pd2m9p.zip