Explore BrainMass
Share

Analyzing Basic Algorithms

This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

Given a list L[0:n - 1], one way of maintaining a sorted order of L is to use an auxiliary array Link[0:n - 1]. The array Link[0:n - 1] serves as a linked list determining the next highest element in L, so the elements of L can be given in nondecreasing order by
L[Start], L[Link[Start]], L[Link[Link[Start]]], and so forth. Then Linkn-1[Start] is the index of the largest element in L, and we set Link[Linkn-1[Start]] = Linkn[Start] = 0 to signal the end of the linked list. Design a version of MergeSort that uses the auxiliary array Link.

See attached file for full problem description.

© BrainMass Inc. brainmass.com March 21, 2019, 2:57 pm ad1c9bdddf
https://brainmass.com/computer-science/sorting/analyzing-basic-algorithms-137563

Attachments

Solution Preview

** Please see the attached file for the complete solution response **

Given a list L[0:n - 1], one way of maintaining a sorted order of L is to use an auxiliary array Link[0:n - 1]. The array Link[0:n - 1] serves as a linked list determining the next highest element in L, so the elements of L can be given in nondecreasing order by
L[Start], L[Link[Start]], L[Link[Link[Start]]], and so forth. Then Linkn-1[Start] is the index of the largest element in L, and we set Link[Linkn-1[Start]] = Linkn[Start] = 0 to signal the end of the linked list. Design a version of MergeSort that uses the auxiliary array Link.
procedure MergeSort(L[0:n-1], low, ...

Solution Summary

This solution provides a detailed step by step solution to the given computer science problem involving algorithms .

$2.19