Question: Throughout this assignment, adopt the following notation: a || B denotes the concatenation of lists a and B (in this order); e denotes the emply

 Throughout this assignment, adopt the following notation: a || B denotes

Throughout this assignment, adopt the following notation: a || B denotes the concatenation of lists a and B (in this order); e denotes the emply string len(s) 20 denotes the length (number of characters) on string s; minx(A[a... b]) denotes the index (in range (a... b]) of the minimum odd element from list A[a...b]; 4 =a+L(b-a)/3] and 12 =b-f(b-a)/31 denote the indices at one third and two thirds the way from a lo b, respectively; pairsort(X,Y) denotes either Y | X (if X and Y are both odd and X>Y) or X | Y (other- wise). Consider the problem of sorting the odd elements in a list of integers while keeping the even ones unchanged in their original places. Sort the odd elements in a list (ODDSORT) Input: A[1...n] a list of integers. Output: List A'[1...n] such that A'[i] = A[i] if A'[i] is even, and A'[i] = A' [j] for all isis jsn such that A'li) and A' [j] are both odd. Now consider the problem of finding the concatenation of all strings whose length is a perfect square from a list, where the Boolean function issqr(n) determines whether or not nis a perfect square (that is, issqr(n) is true iff n is an integer of form n=r? for some integer r): Concatenation of All Strings whose Length is a Perfect Square (CONCATSQR) Input: Sla...b], a list of strings. Output: c = s[i]... S[iml where i <... issqr for all is ksm and false other indices j otherwise c="{" if s contains no string whose length a perfect square. points let represent the solution of concatsqr problem on input state two different divide-and-conquer self-reductions above. give recursive algorithms pseudo-code based your to solve problem. what are worst-case runtimes solutions you have obtained runtimes. do not need show work. throughout this assignment adopt following notation: b denotes concatenation lists order e emply len characters minx index range minimum odd element from list denote at one third thirds way lo respectively pairsort either y x both>Y) or X | Y (other- wise). Consider the problem of sorting the odd elements in a list of integers while keeping the even ones unchanged in their original places. Sort the odd elements in a list (ODDSORT) Input: A[1...n] a list of integers. Output: List A'[1...n] such that A'[i] = A[i] if A'[i] is even, and A'[i] = A' [j] for all isis jsn such that A'li) and A' [j] are both odd. Now consider the problem of finding the concatenation of all strings whose length is a perfect square from a list, where the Boolean function issqr(n) determines whether or not nis a perfect square (that is, issqr(n) is true iff n is an integer of form n=r? for some integer r): Concatenation of All Strings whose Length is a Perfect Square (CONCATSQR) Input: Sla...b], a list of strings. Output: c = s[i]... S[iml where i <... issqr for all is ksm and false other indices j otherwise c="{" if s contains no string whose length a perfect square. points let represent the solution of concatsqr problem on input state two different divide-and-conquer self-reductions above. give recursive algorithms pseudo-code based your to solve problem. what are worst-case runtimes solutions you have obtained runtimes. do not need show work.>

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!