Assume that you are given the following linear time algorithm: BSTNode *BuildBST(A, n): It takes an array and its size as arguments, builds a binary search tree, and returns a pointer to its root in θ(n) time. A BSTNode structure contains pointers LC, RC of type BSTNode* pointing to the left child and right child of that node respectively. Step 1: Use the above function to write pseudocode to output the array in ascending order in linear time. PrintAscending(A,n){ //Output elements of A in ascending order //Write pseudocode below
In this question, you will find the maximum subarray of the…
In this question, you will find the maximum subarray of the array A = using the θ(nlog(n)) divide and conquer algorithm discussed in class. Step 2: Show how the algorithm computes the answer.
In this question, you will construct the max heap that resul…
In this question, you will construct the max heap that results from using BUILD-MAX-HEAP to create a heap from the following array: . Steps 1-2 were performed above. Now perform step 3: Step 3. Fill in the tree which results after the second exchange is performed. / \ / \ / \ / \ / \
In this question, you will find the maximum subarray of the…
In this question, you will find the maximum subarray of the array A = using the θ(nlog(n)) divide and conquer algorithm discussed in class. Step 5: Give the recurrence relation for the maximum subarray algorithm FIND-MAXIMUM-SUBARRAY. That is fill in the right hand side of the following equation: T(n) =
In this question, you will construct the max heap that resul…
In this question, you will construct the max heap that results from using BUILD-MAX-HEAP to create a heap from the following array: . Steps 1-4 were performed above. Now perform step 5: Step 5. Fill in the tree which results after the fourth exchange is performed. The tree is the finished max heap in the pointer representation. / \ / \ / \ / \ / \
In this question, you will construct the max heap that resul…
In this question, you will construct the max heap that results from using BUILD-MAX-HEAP to create a heap from the following array: . Steps 1-3 were performed above. Now perform step 4: Step 4. Fill in the tree which results after the third exchange is performed. / \ / \ / \ / \ / \
In this question, you will use dynamic programming to determ…
In this question, you will use dynamic programming to determine the longest common subsequence of and . Step 1. Provide the recursive equation for the recurrence. That is, complete the right hand side: c =
In this question, you will use dynamic programming to determ…
In this question, you will use dynamic programming to determine the longest common subsequence of and . Step 2. Use the LCS-Length algorithm to select the correct b-entry (arrow) and c-entry (number) for each entry in the table. ____ j____ ____0____ 1 2 3 4 5 6 ____i____ ____yj____ A C G T T A ____0____ ____xi____ ____0____ 0 0 0 0 0 0 ____1____ ____C____ ____0____ ____2____ ____A____ ____0____ ____3____ ____G____ ____0____ ____4____ ____T____ ____0____ ____5____ ____A____ ____0____
In this question, you will find the maximum subarray of the…
In this question, you will find the maximum subarray of the array A = using the θ(nlog(n)) divide and conquer algorithm discussed in class. Step 5: Give the recurrence relation for the maximum subarray algorithm FIND-MAXIMUM-SUBARRAY. That is fill in the right hand side of the following equation: T(n) =
In this question, you will construct the max heap that resul…
In this question, you will construct the max heap that results from using BUILD-MAX-HEAP to create a heap from the following array: . Steps 1-5 were performed above, yielding the finished max heap in Step 5. Now fill in the array A to give the array representation of the max heap. A A A A A A A A A A A