A company wishes to produce a greyscale display with pixels so…

Question Answered step-by-step A company wishes to produce a greyscale display with pixels so… A company wishes to produce a greyscale display with pixels so small that a humanwill be unable to see the individual pixels under normal viewing conditions.What is the minimum number of pixels per inch required to achieve this? Pleasestate all of the assumptions that you make in calculating your answer. It may behelpful to know that there are 150 000 cones per square millimetre in the humanfovea, and that there are exactly 25.4 millimetres in an inch.[6 marks]If the pixels could be only black or white, and greyscale was to be achieved byhalftoning, then what would the minimum number of pixels per inch be in orderthat a human could not see the halftone dots? Again, state any assumptions thatyou make.[2 marks]The company currently produces a display device with 2-bit greyscale (that is: fourdi erent shades of grey). Describe an error-di usion algorithm which will convertan 8-bit greyscale image into a 2-bit image suitable for display on this device. [Note:the two images must have the same number of pixels.][7 marks]Illustrate that your algorithm works using the following test image.20040250220[2 marks]You are asked to design a 44 ordered dither matrix. What rules should you followin the design?Consider the function zarg defined below:fun zarg f ([], e) = e| zarg f (x::xs, e) = f(x, zarg f (xs,e));Show that with the help of this function, it is possible to write an expression forthe sum of a given list of integers. Then describe what zarg does in general.(c) A polymorphic type of branching trees can be declared as follows. Note thatthe children of a branch node are given as a list of trees, and that only the leafnodes carry labels.datatype ‘a vtree = Lf of ‘a| Br of (‘a vtree) list;(i) Write  function flat t that converts a given tree t of this type to a listof the labels (without eliminating duplicates). Your function should run inlinear time in the size of the tree. [4 marks](ii) Write  function count x t that counts the number of times that x occursas a label in t, but without first converting t to a list.(iii) What is the type of count? Consider the problem of eliminating all duplicates from a list of strings. Write code for a function of type string list -> string list such that the output contains the same elements as the input, possibly reordered, but where every element occurs exactly once. The worst-case performance must be better than quadratic in the length of the list Java generics allows an ArrayList object to be constrained to use a single specifictype (e.g. ArrayList). However, some applications require the ability tostore objects of multiple unrelated types. In this question the aim is to store Integerobjects alongside LinkedList objects.(a) One solution is to use ArrayList, since all Java objects extend Object.Explain why this is bad practice. [2 marks](b) Seeking to provide a solution that allows an arbitrary set of constrained types,a programmer writes an abstract ConstrainedArray base class. To use it, theclass is extended and a specialised void add(…) method should be providedfor each acceptable type.public abstract class ConstrainedArray {protected ArrayList mArray =new ArrayList();public Object get(int idx) {return mArray.get(idx);}public int size() { return mArray.size(); }}(i) Show how to create a class IntListArray that extends this base classand accepts only Integer or LinkedList objects. Whereappropriate, objects should be copied on insertion. [4 marks](ii) Describe a sequence of events that would allow external modification of anobject stored within an IntListArray, despite correct copying on insertion.How could this be addressed in IntListArray? [3 marks](iii) By adding protected void add(Object o) {mArray.add(o);} to theConstrainedArray class, the mArray field can be made private. Show howthis would affect your IntListArray class and discuss the advantages ofthe change from protected to private. Write code to repeatedly ask the user for a number.If the number is positive and even, print out a happy message.Write  Java program to ask the user to input an integer number from the keyboard. The output should indicate whether it is positive, zero, or negative, an even number or an odd number.write  complete Java program that reads integer numbers from the user until a negative value is entered. It should then output the average of the numbers, not including the negative number. (a) We consider the minimum spanning tree problem. For each of the following three scenarios, which algorithm would you use for efficiency and what would its running time be? (i) Graph with V vertices, E = ?(V 3/2 ) edges with arbitrary weights in R. (ii) Graph with V vertices, E = ?(V (log V ) 2 ), where edges have already been sorted according to their weights. (iii) Graph with V vertices, E = ?(V ) edges with arbitrary weights in {0, 1, . . . , blog V c}. [6 marks] (b) What are the advantages and disadvantages of the Bellman-Ford Algorithm in comparison to Dijkstra’s Algorithm? Let  dab be a set of disjoint segments on the real axis.(a) Write Dab class in Java that supports equality testing between two dabsin linear time. Provide only the data members without any constructors ormethods, and highlight any noteworthy features and invariants.Note: You may not use any pre-made lists, resizable arrays or other librarycollections of any kind; use only integers, doubles, pointers, arrays and classes.You are allowed to define additional classes if necessary. [4 marks](b) Draw  records-and-pointers diagram representation of the following dab{(?2.3, ?1),(10, 24.53),(2, 6)}using your class from part (a). [2 marks](c) Given a set S of dabs, find an algorithm that returns a dab of maximumcardinality containing only segments from the dabs in S. The algorithm shouldrun in O(n2) time, where n is the total number of segments of all dabs containedin S.(i) Clearly describe and explain  algorithm.(ii) Describe algorithm in a few lines of pseudocode.answer all questionsImage transcription textQ4) Consider the functions: (1, for x20 ((x) = 10.for x <0 and g(x) = 0. forx 2 0 1. for x <0 Is the f... Show more... Show moreImage transcription textQuiz — Homework— [5 Marks} Answerthe following questions from your ownunderstanding. You can u... Show more... Show more  Computer Science Engineering & Technology Networking NET WORKIN COSC3342 Share QuestionEmailCopy link Comments (0)

© Copyright 2020 Online Freelancers Network.com