Question: Guidelines for writing pseudocode : C/Java/Python instructions are fine. But do not write object-oriented additions. Do not declare or use any class. Declare only procedures
Guidelines for writing pseudocode:
-
C/Java/Python instructions are fine. But do not write object-oriented additions. Do not declare or use any class. Declare only procedures (if necessary) and explain in words what each procedure does, and what is the use of each parameter.
-
One instruction per line
-
Match the brackets with a horizontal line
-
Number your lines
-
Write down if your array is indexed 0...n1 or 1...n.
-
If you decide to use procedures/functions/methods from the class (such as, say, DELETE- MAX(S) for S a max-heap), explain clearly what they do and in what running time. Explain the data structures, if any.
Question: We are given two arrays of size n A and B, of integers, Consider the n closed intervals [A[i],B[i]], which may not be disjoint. The union of these n intervals is another set of intervals, which can be made disjoint and maximal. Present an O(n log n) algorithm to output this new set of disjoint and maximal intervals into arrays C and D. Present pseudocode and analyze the running time.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
