Question: Estimate how many bits the algorithm would use to encode a string consisting of 2000 repetitions of the character A. [8 marks] 4 Comparative Programming
Estimate how many bits the algorithm would use to encode a string consisting of 2000 repetitions of the character "A". [8 marks] 4 Comparative Programming Languages (a) Discuss to what extent a programmer can expect a program that conforms to a standard to generate identical results when run under different conforming compilers on different machines. Discuss the reasons why languages such as Fortran, Algol and PL/I designed in 1900s and 2000s are less widely used than languages designed in the last 20 years. [6 marks] Describe the tasks that should be carried in implementing a front end for this language and any difficulties that might be encountered. Suppose that the target virtual machine is stack-oriented and that the stack elements are integer values, and addresses can be stored as integers. Explain which other features are required in such a virtual machine. let val x = MLreadint() in MLwriteint(x+1); x end (i) Show that for all n > 0 (n + 1) = 1.(n + 1) + (n). [9 marks] Hence determine a general formula for (n). (iii) What effect will a working framework oversaw setting switch have on reserve hit rate? Legitimize your response. (iv) Modern work area and server processors support concurrent multithreading (additionally called hyperthreading). At the point when will there be an exhibition benefit in Consider the use of a monad for input-output. For the purposes of this question, take the IO monad as including two operations readint and writeint which respectively read integers from stdin and write integers to stdout. Give the types of these operators. [5 marks] (c) Assume MLreadint and MLwriteint are primitives with side effects for inputoutput and consider the ML expression add1 of type int: booking two non-intelligent applications on the equivalent hyperthreaded processor center so they run in equal as opposed to running consecutively, one work one after the other? NOTE: ENSURE YOUR WORK HAS NOT BEEN TAKEN FROM PREVIOUS ANSWERS THAT ONE WILL BE A VIOLATION BECAUSE I WILL CHECK AND REPORT YOU. I ALREADY HAVE THE ANSWERS I NEED A NEW THING. The way to compute any given position's value is to add up the numbers to the position's right and left in the preceding row. i need a program that, when run, will print out its source code. This source code, in turn, should compile and print out itself. (Fun fact: a program that prints itself is called a quine.) 3)given an array of integers, the goal is to efficiently find the subarray that has the greatest value when all of its elements are summed together. Note that because some elements of the array may be negative, the problem is not solved by simply picking the start and end elements of the array to be the subarrray, and summing the entire array. For instance, to compute the middle number in the third row, you add 1 and 1; the sides of the triangle are always 1 because you only add the number to the upper left or the upper right (there being no second number on the other side). (i) What is an information reserve and how can it contrast from a guidance store? (ii) What factual properties of memory access reserves exploit to convey further developed execution?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
