CSC 1351 Chapter : 1351 Practice 3 Recursion

7 views1 pages
15 Mar 2019
School
Course
Professor

Document Summary

Shown below in (a)-(b) are the rst two of the three steps in the pseudocode for merge-portion of the merge- It assumes that mergesort(left, mid) and mergesort(mid+1, right) have been completed in ordering the subarraya nums[leftmid] and nums[mid+1right] in increasing order. (a) [show this part of the pseudocode; be brief but very clear. ] Give an example of nums[] after the calls mergesort(0, 3) and mergesort(4, 6) have completed such that step (c) makes no change in nums-array. (assume nums[] was initially a permutation of {0, 1, , 6}. ) Give an example of nums[] after the calls mergesort(0, 3) and mergesort(4, 6) have completed such that step (c) changes every item in nums-array. (assume nums[] was initially a permutation of {0, 1, , 6}. ) Consider a call-return diagram for some recursive function f( ), which makes at most two recursive calls, as shown below. (we do not know at this point any things else about f( ). )

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents