Java programming. Solve all Questions Appropriately. (a) Java's Reference Objects furnish a way to collaborate with the
Question:
Java programming. Solve all Questions Appropriately.
(a) Java's Reference Objects furnish a way to collaborate with the runtime garbage man. (I) Provide a Java class carrying out a Leaky Array: a fixed-size, requested arrangement of Objects, listed by numbers from zero upwards. The things might be disposed of (separately) by the trash specialist when the framework is running dangerously short on memory. Give simultaneousness safe accessor strategies to get and set the things put away in the cluster. Guarantee that any inward information structures can't be controlled other than by means of your accessor strategies. It ought to be feasible for classes in different bundles to build new Leaky Array protests and have the option to summon the accessor techniques. Inferred classes ought to have simultaneousness safe method for deciding the size of the cluster (yet not be able to change it) and counting the quantity of not-invalid things put away. [6 marks] (ii) Describe cautiously when a Finalizer strategy characterized on a Java class will be executed. Might two finalizers be executed simultaneously? What assurances does Java make about the execution of finalizers? [5 marks] (iii) How might a ReferenceQueue at any point be utilized to give more control than finalizer techniques? [4 marks] (b) Does Java's garbage man tidy up memory apportioned by code in a local strategy? What offices exist to indicate whether Java objects made by local code are qualified for trash assortment? [5 marks] 5 Computer Graphics and Image Processing (a) Standard variety printing utilizes the four ink tones: cyan, maroon, yellow and dark. (I) Explain why this is so. [3 marks] (ii) What advantages are there in utilizing more than these four ink tones? [3 marks] (b) Describe a calculation for changing over a greyscale picture to a bilevel (high contrast) picture while holding as great a quality as could really be expected. Your calculation ought to be for the circumstance where each greyscale pixel guides to a solitary bilevel pixel. [6 marks] (c) Describe procedure on pictures which accomplish the accompanying impacts: (I) ease up a picture which is excessively dim; [2 marks] (ii) eliminate salt and pepper commotion ("shot clamor") from a picture; [2 marks] (iii) find 45 edges in a picture; [2 marks] (iv) convert a variety picture (in RGB design) to a greyscale picture while safeguarding the apparent luminance. [2 marks] 5 (TURN OVER) CST.2006.6.6 6 Compiler Construction (a) Describe a distinction and a likeness between the thoughts of over-burdening and polymorphism. [2 marks] (b) Define the idea of type wellbeing in a programming language. [2 marks] (c) Describe the connecting stage and the distinction among static and dynamic connecting. [2 marks]
Expecting possible find a standard language L with the ultimate objective that L is a subset of Pal, then again in case this is ridiculous figure out why. Moreover either find a standard language L 0 so that Pal is a subset of L 0 , or again figure out why this ought not be imaginable. [6 marks] 9 Unix Case Study (a) Draw a framework of the area space of a Unix collaboration. Show which parts may be granted to various cycles. [5 marks] (b) Explain the Unix structure call instrument. [5 marks] In one sentence, portray the different complements of these two plans. [1 mark] (b) State two likely heuristics to help with dealing with this issue. [2 marks] (c) For a coordinator to address this enigma, what managers (for instance organizing exercises) could be required? [7 marks] 3 [TURN OVER CST.93.12.4 8 Databases Describe the social model of data. [4 marks] What is inferred by a promising new kid on the block key? [2 marks] Explain what it means for a social data model to be presented in (a) Third Normal Form (3NF) [5 marks] (b) Fourth Normal Form (4NF) [5 marks] for every circumstance addressing your reaction with a sensible model data model. In what conditions could holding social data as demonstrated by these customary structures not be sensible? [4 marks] 9 Introduction to Functional Programming Consider the ML definitions fun N f x = x; fun P a k f x = f a (k f x); fun Q k l f x = k f (l f x); fun W a k = Q k (P a N); fun R k = k W N; Suppose further that K and L have ML implications of the design val K = P a1 (P a2 . . . (P man-made insight N) . . . ); val L = P b1 (P b2 . . . (P bj N) . . . ); In parts (b) to (d) underneath, acknowledge that f and x are sporadic ML identifiers of sensible kind for the verbalization containing them. (a) State the ML kinds of N and P. [3 marks] (b) What does the verbalization K f x evaluate to? [3 marks] (c) What does the verbalization Q K L f x survey to? [4 marks] (d) What does the explanation R K f x evaluate to? [10 marks] 4 CST.93.12.5 10 Computation Theory Show that there is positively no possibility of picking by estimations whether a general register machine program with code p will end when started with starting data of 0 in each register. [10 marks] Show that there is definitely no way of picking by estimation whether the unmistakable individual will be printed over the range of a general Turing machine computation. [10 marks] Note: any standard sort of the undecidability result for the general halting issue may be acknowledged, but should be communicated doubtlessly.
(a) Explain what the pile information structure is, express its characterizing properties and clarify how for convert between the tree and vector portrayals of a store. [2 marks] (b) Describe an ideally productive calculation for changing any arbitrary vector into a store vector and make sense of why it works. [4 marks] (c) Using the tree rather than the vector portrayal foproducing an edge by-outline hint of the execution. For this response, kindly utilize the sheet for part (c), provided with the inquiry paper, and utilize another tree at whatever point any hubs change. [5 marks] (d) Explain how to modify the store in the wake of having removed its top with the goal that what remains is as yet a stack. Follow this strategy to separate the main three qualities, individually, from the store you constructed, creating a casing by-outline follow as above. Kindly utilize the sheet for part (d). [5 marks] (e) Describe a method for embedding another worth into a current store in time O(log n) where n is the pile size. [4 marks] Further duplicates of the sheets for parts (c) and (d) might be acquired from the Invigilator, whenever required. Guarantee that you join the sheets to the remainder of your response. 2 CST.2006.6.3 2 Computer Design (a) Early processors utilized a gatherer to hold a middle of the road result while additional advanced processors utilize a register document or a stack. (I) Why utilize a stack or register record as opposed to a collector? [4 marks] (ii) What are the benefits and hindrances of utilizing a register document instead of a stack? [6 marks]
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest