Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please provide space characterization for part a and b in question 2 and justify in question 4 only complete the statement missing 9 and 14

image text in transcribed

please provide space characterization for part a and b in question 2 and justify

image text in transcribed

in question 4 only complete the statement missing 9 and 14 u don't need to do below part just provide missing statements for part 4 please i need space characterization for part a and b and missing statements for part 4 asap do It hurry up please

4. 10 pts.]A common operation in many applications of mathematical computing is the camulative product of positive integers oa- defined as, for all ai The following is pseudoode for two algorithms, CumProdl and CumProd2, to perform this operaton Both algorithms take as input an n-element array A such that each element Ali! for all i 0,1, . , . ,n-1, and output another 72-element array X such that X)-, where each , for0.,n 1, is as defined mathematically above Algorithm 1 CumProdl A) 2: for to do 4: for 1 to.) do 6: end for 7: end for 8: return X Algorithm 2 CumProd2(A) 2: for j1 o1 do l: end for 5: return X (a) Give the tightest/best worst-case running-time and space characterization, Big- Oh, Big-Theta, or Big-Omega, in terms of n, of CumProd Justify your answer Page 5 of 15 CIS 350: Data Structures and Algorithm Analysis (b) Give the tightest,best worst-case running time and space characterization, Big. Oh, Big-Theta, or Big-Omega, in terms of n, of CumProd2. Justify your answer 4 pts.] Complete the pseudocode of the successor function for a BST, started for you in the partial pseudocode give in Algorithm 6, by wrting down the only two missing statements in le indexes 9 and 14). The function outputs the node y with the next key in the order sequence following that of node with respect to the BST, or NULL if w has the largest key 2. Algorithm 6 successor 1: if = NULL then 3: else 4: if u.right = NULL then 5: 9 .parent while yNULL and y.right = z do 7: 8: 9: end while 11 else 12: 13: while y.right NULL do end while 15: 16 end if 17: end if 18: return y Using big-Oh notation, provide a tight worst-case ung time of the method as a function of the number of nodes in the BST containing w

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions

Question

Write a statement equivalent to ( (p q) (q, Using only ( and (?

Answered: 1 week ago