Module B: A state rand0%4; if (A state1) global time 6 Module C: private int C state parametersi,よ1;//acall with...
Module B: A state rand0%4; if (A state1) global time 6 Module C: private int C state parametersi,よ1;//acall without defining parameterjis fine if (i9%2) C state 7: else C state- 100 return C state +randOA if((module) Crand0M) > 10) Module D: < "good"くくendl; cout 5. Coding with quality reqwst Provide brief analyses justifications of the time complexities for all questions (a) (8 pts) For a sorted array A of n different elements ranging from I to n. Suppose one element is randomly chose repeated, one such array is (1, 2, 3, 4, 5, 5, 61 where n-6 and value 5 is repeated. Develop an alporithm o complexity O Clog n) to seek out the only repeated element. (b) (8 pts) Write an iterative function merge sort(A) to sort array A in descending order using the idea of merge sort b recursive callings Give two sorted arrays A and B, develop a function to generate a new sorted amay C that consin elements strictly f om A and B alternarvely, ia, if A. IASİ, BH26],then C-12461 ir Adan B-p then C-15]. Your code should handle all possible cases that may arise
Module B: A state rand0%4; if (A state1) global time 6 Module C: private int C state parametersi,よ1;//acall without defining parameterjis fine if (i9%2) C state 7: else C state- 100 return C state +randOA if((module) Crand0M) > 10) Module D: