Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

They all say that they have much better fuel economy than conventional vehicles. And it seems that the performance of hybrid cars matches all expectations.

They all say that they have much better fuel economy than conventional vehicles. And it seems that the performance of hybrid cars matches all expectations. [14 marks] 11 CST.2005.11.13 10 Complexity Theory (a) [3 marks] (ii) If Reach is NP-complete then NP6=PSPACE. [3 marks] (iii) If Sat is PSPACE-complete then NP=PSPACE. To what extent does this support Turing's Thesis? [Explicit program for a register machine is not required.] [8 marks] 8 Computer Graphics and Image Processing Describe an algorithm for performing scan conversion of a set of 3D polygons, including details of clipping, projection, and the underlying 2D polygon scan conversion algorithm. You may assume that you are given the colour of each polygon and that no lighting calculations are required. Please state any additional assumptions that you need to make. Ray tracing is not an acceptable answer to this question. Discuss the reasons why languages such as Fortran, Algol and PL/I designed in 1950s and 1960s are less widely used than languages designed in the last 20 years. [6 marks] 3 [TURN OVER CST.2004.3.4 5 Operating Systems II (a) What problem do real-time scheduling algorithms try to solve? [2 marks] (b) Describe one static priority and one dynamic priority real-time scheduling algorithm. Assign the Last host IP address from Network P subnet to G0/1 interface of Ri. b. Assign the First host IP address from Network P subnet to Sl. c. Assign the Second host IP address from Network P subnet to PCI. d. Assign the Last host IP address from Network Q subnet to GO/1 interface of R2. e. Assign the First host IP address from Network Q subnet to S2. f. (a) Describe what is meant by tail recursion. [4 marks] (b) Eliminate tail recursion from foldl given below. Explain your answer. (* foldl : ('a -> 'b -> 'a) -> 'a -> 'b list -> 'a *) let rec foldl f accu l = match l with [] -> accu | a::l -> foldl f (f accu a) l [8 marks] (c) Eliminate tail recursion from the following mutually tail-recursive functions. Explain your answer. let rec is_even n = if n = 0 then true else is_odd (n - 1) and is_odd n = if n = 0 then false else is_even(n - 1) [8 marks] 4 CST.2016.3.5 4 Compiler Construction Consider writing a compiler for a simple language of expressions given by the following grammar, e ::= n (integer) | ? (read integer input from user) | e + e (addition) | e e (subtraction) | e e (multiplication) | (e, e) (pair) | fst e (first projection) | snd e (second projection) (a) Explain which other features are required in such a virtual machine. Invent a simple language of instructions for such a machine and show how it would be used to implement each of the expressions. b) Project progress visualisation tools such as PERT and GANTT charts. (c) Automated regression testing tools. (d) Source code management tools. (e) Scrumming. [8 marks] 5 [TURN OVER CST.2004.13.6 6 Compiler Construction (a) Explain the differences (illustrating each with a small program) between (i) static and dynamic binding (scoping); [4 marks] (ii) static and dynamic typing. [2 marks] (b) Java is sometimes said to be "dynamically typed" in that a variable whose type is (class) C can be assigned a value of (class) D provided that D extends C; conversely a variable of type D can be assigned a value of type C using a cast. Well-known utility functions may be assumed to be available. 3 (TURN OVER) CST.2011.4.10 11 SECTION B 3 Object-Oriented Programming Java generics allows an ArrayList object to be constrained to use a single specific type (e.g. ArrayList). However, some applications require the ability to store objects of multiple unrelated types. I

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intro Stats

Authors: Richard D. De Veaux, Paul F. Velleman, David E. Bock

3rd edition

321533283, 321533289, 9780321463708, 9780321503848, 9780321503800, 9780321499431, 9780321499417, 978-0321500458

More Books

Students also viewed these Mathematics questions