Connect on Whatsapp : +97143393999, Uninterrupted Access, 24x7 Availability, 100% Confidential. Connect Now

• Course Code: CP5602
• University: James Cook University
• Country: Australia

## Question:

Aim: This assignment is designed to evaluate/improve your critical thinking and problem solving skills. It also evaluate/improve your coding skill.

1. For a tree T, let nI denote the number of its internal nodes, and let nE denote the number of its external nodes. Show that if every internal node in T has exactly 3 children, then nE = 2nI + 1. [2 marks]
2. Suppose we are given two ordered search tables S and T, each with n elements (with S and T being implemented with arrays). Describe an O(lg2n)-time algorithm for finding the kth smallest key in the union of the keys from S and T (assuming no duplicates).
3. Although merge sort runs in (n lg n) worst-case time and insertion sort runs in (n2 ) worst case time, the constant factors in insertion sort make it faster for small n. Thus, it makes sense to use insertion sort within merge sort when sub problems become sufficiently small. Consider a modification to merge sort in which n/k sub lists of length k are sorted using insertion sort and then merged using the standard merging mechanism, where k is a value to be determined.
4. i) Show that the n/k sub lists, each of length k, can be sorted by insertion sort in (nk) worst-case time. [1 mark]
5. ii) Show that the sub lists can be merged in (n lg(n/k)) worst-case time. [2 marks]

Given that the modified algorithm runs in (nk + n lg(n/k)) worst-case time, what is the largest asymptotic (notation) value of k as a function of n for which the modified algorithm has the same asymptotic running time as standard merge sort. [3 marks]

Consider the recurrence T(n) = 3T(⌊n/2⌋) + n.

i) Use the master method to give tight asymptotic bound for this recurrence (if the master method cannot be used, explain why).

ii) Use a recursion tree to determine a good asymptotic upper bound on this recurrence. [2 marks]

When an adjacency-matrix representation is used, most graph algorithms require time ?(V2 ), but there are some exceptions. Show that determining whether a directed graph G contains a universal sink (i.e. a vertex with in-degree |V | − 1 and out-degree 0) can be determined in time O(V ), given an adjacency matrix for G. [5 marks]<span style="mso-spacerun:'yes';font-family:Arial;mso-fareast-font-family:'Times New Roman'; mso-bidi-font-family:'Ti

### Cite This Work

[Accessed 19 August 2022].

My Assignment Help. 'Advanced Algorithm Analysis' (My Assignment Help, 2021) <https://myassignmenthelp.com/free-samples/cp5602-advanced-algorithm-analysis/optimization-algorithms-for-networks.html> accessed 19 August 2022.

My Assignment Help. Advanced Algorithm Analysis [Internet]. My Assignment Help. 2021 [cited 19 August 2022]. Available from: https://myassignmenthelp.com/free-samples/cp5602-advanced-algorithm-analysis/optimization-algorithms-for-networks.html.

### Content Removal Request

If you are the original writer of this content and no longer wish to have your work published on Myassignmenthelp.com then please raise the content removal request.

## 5% Cashback

On APP - grab it while it lasts!