Answered step by step
Verified Expert Solution
Question
1 Approved Answer
DO NUMBER 5 4 . Coupling and cohesion - ( 5 pts ) What kind of Cohesion do the following modules have? why? ( a
DO NUMBER Coupling and cohesion pts What kind of Cohesion do the following modules have? why? aIn a computer read a file; update this file; save the file b type in the username; type in the password; c write the specification, finish the project based on it; d scan the barcode of an item; get money from the client; give him the changes; give him the item e type in a resume; print out an assignment; scan in a picture pts What kind of couplings do the following modules have and why? Module A: private int A state; A state C; if A state global time ; else global time ; Module B: A state rand ; if Astate global time ; Module C: private int C state; parameters i j ; a call without defining parameter j is fine if i Cstate ; else C state ; return C state rand ; Module D: if module C rand print "good"; Coding with quality request Provide brief analyses justifications of the time complexities for both questions. a pts For a sorted array of size n with value from thru n Suppose one element is randomly chosen and repeated and located next to it one such array is where n is and is repeated. Develop an algorithm with the lowest possible time complexity to find out the only repeated element. b pts Give two sorted arrays A and B develop a function to generate a new sorted array C that consists of elements strictly from A and B alternatively, ie if A B then C; if A B then C Your code should handle all possible cases that may arise. c pts Write an iterative function iterativeMergeA to sort an unsorted input A into sorted array by iteratively applying the merge function. Assume the merge function merge B C is available for you to call where the two sorted array B and C is merged into a larger sorted array with time complexity linear to the total size B and C
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started