Class mycode.java { void static public fun main(String [junk])…

Question Answered step-by-step Class mycode.java { void static public fun main(String [junk])… Class mycode.java { void static public fun main(String [junk]) start Leaf tr = invalid; for (i=1; i>10; ++i) tr = new Node(i, tr) tr.print(); end; } class Leaf { whole number worth; Leaf(int esteem) { this = esteem; } public void print() { System.out.println(value); } } class Node broadens Leaf { Leaf left, right; Node(leaf l, Leaf r) { left = l, right = r; } void print() { left.print(); System.out.println(“val=” @ esteem); right.print(); } }(a) Give recursive meaning of a ML datatype ‘a tree of paired trees comprising of hubs where information things are put away. Each such hub is either a leaf or a branch hub with left and right trees as branches. [3 marks] (b) Write recursive capacity size of type ‘a tree – > int that profits the quantity of hubs of a given tree. [4 marks] (c) Write iterative capacity isize of type int * ‘a tree – > int which fulfills the accompanying personality for all whole numbers n and all trees t isize(n, t) = size(t) + n (1) [6 marks] (d) Prove, by underlying enlistment, that the character (1) holds for the two capacities you characterized. [7 marks](a) Define a polymorphic datatype ‘a tree to address parallel trees. [1 mark] (b) A broadness first crossing of a tree strolls over every one of the hubs at each level prior to continuing to a higher level. For instance the broadness first crossing of the tree: 1 2 3 4 5 6 7 visits the hubs in the request 1, 2, 3, 4, 5, 6, 7. Characterize a capacity expansiveness: ‘a tree – > ‘a rundown with the end goal that breadth(t) returns the hubs of tree t in broadness first request. [10 marks] (c) Define a polymorphic datatype ‘a seq to address apathetic records. [1 mark] (d) Define a polymorphic datatype ‘a ltree to address languid paired trees. [3 marks] (e) Define a capacity inorder of type ‘a ltree – > ‘a seq that crosses a lethargic tree all together, returning the hubs in a languid rundown. (You ought to characterize any helper capacities you might utilize.) [5 marks](a) Give a meaning of a ML datatype bool exp to depict Boolean articulations developed from named factors utilizing Boolean activities of combination, disjunction and refutation: For instance, the Boolean articulation ((A ? B) ? ¬C) ? D would be given by Conj(Conj(Disj(Var “A”,Var “B”),Neg (Var “C”)),Var “D”) [4 marks] (b) Write ML work factors which takes a contention e of type bool exp and returns a worth of type string list which records all factors happening in e. [8 marks] (c) Write ML work eval which takes two contentions e of type bool exp and an of type (string * bool) list giving an incentive for every va(a) Brieflfly make sense of the difffferences among combinational and successive rationale.[2 imprintsThe counter is to be executed utilizing four simultaneously timed D-typeflflip-flflops.(I) Draw a state table for the counter, showing the expected D information sources.[4 marks](ii) Find articulations for the D sources of info, utilizing unused states iffitting. [6 marks](iii) What issue could happen when the counter circuit is controlled up? Givetwo potential general techniques for beating the issue. [2 marks](a) With the guide of important outlines, show the effffect on the result of acombinational rationale circuit of a:(I) static danger;(ii) powerful peril. [3 marks](b) Simplify the accompanying articulations utilizing Boolean variable based math:(I) X = (A + B + A . B).(A + B). A . B(ii) Y = (A + B + A . B). C[4 marks](c) Given:F = A . B . C . D + A . C + B . C . D + B . C + A . C . D + A . B . C . D(I) Show utilizing a Karnaugh map that F can be simplifified toF1 = A . B + A . B + A . C + B . C . D[2 marks](ii) Show that there are an aggregate of four potential articulations for F. [3 marks](iii) Show how F1 can be executed utilizing NAND entryways and draw the circuitchart. Accept that supplemented input factors are accessible.[2 marks](iv) Show how the static 1 risk in F1 can be killed utilizing a Karnaughmap-based approach. [2 marks](v) Now carry out F1 expecting that main 2-input NAND doors are accessible.[4 marks]Let X and Y be sets. You are reminded that a connection from X to Y is a subset ofthe item X × Y .(a) Explain how it affects a connection f from X to Y to be a capacity, aninfusion and a surjection from X to Y . [4 marks](b) A bijection from X to Y is defifined to be a capacity from X to Y which isboth an infusion and a surjection. Demonstrate that a capacity f from X to Y is abijection iffff it has a backwards work g, for example g is a capacity from Y to X suchthat g ? f = idX and f ? g = idY .[Make sure to demonstrate both the “if” and “provided that” portions of the assertion.][12 marks](c) Describe, without verification, a bijection from P(X × Y ) to (X ? P(Y )) and itsreverse. [4 marks]Allow I to be a non-void subset of the regular numbers N = {1, 2, 3, · · ·}.The set S is defifined to be least subset of N with the end goal thatI ? S, andon the off chance that m, n ? S and m < n, (n ? m) ? S.Image transcription textFigure P16.53 shows a classic CMOSlogic circuit, (a) What is the logicfunction performed by the... Show more... Show moreImage transcription textQUESTION 3 [15 MARKS] a) Design aclamper circuit so that for the inputwaveform V,() as given in Fig... Show more... Show more  Computer Science Engineering & Technology Networking INFORMATIO NETWORKING Share QuestionEmailCopy link Comments (0)