Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

9 [TURN OVER CST.2004.13.10 10 Introduction to Functional Programming (a) Define a polymorphic datatype 'a tree to represent binary trees. [1 mark] (b) A breadth-first

9 [TURN OVER CST.2004.13.10 10 Introduction to Functional Programming (a) Define a polymorphic datatype 'a tree to represent binary trees. [1 mark] (b) A breadth-first traversal of a tree walks over all the nodes at each level before proceeding to the next level. For example the breadth-first traversal of the tree: 1 2 3 4 5 6 7 visits the nodes in the order 1, 2, 3, 4, 5, 6, 7. Define a function breadth: 'a tree -> 'a list such that breadth(t) returns the nodes of tree t in breadth-first order. [10 marks] (c) Define a polymorphic datatype 'a seq to represent lazy lists. [1 mark] (d) Define a polymorphic datatype 'a ltree to represent lazy binary trees. The token stream as information (by means of calls to work lex()) and giving as result an theoretical language structure tree relating to part (d). Write program to read a string and display its length (number of characters). in c+ : Write program to read a letter and indicate whether the letter is 'a' or not. programing language is VB8 write program to read in a string from the keyboard and display the whole string backward (a) Describe the provisions of the Data Protection Act. [8 marks] (b) You are designing and are about to launch a mobile phone app which will seek to understand the emotional condition of the user, using multiple inputs such as motion sensing, facial expression recognition, voice stress measurement and the analysis of entered text. Its declared purpose is to enable services to interact more empathically with users. You propose to monetize it by serving ads at times when the user is more likely to buy. Your "backers" have raised a concern that this app will be able to diagnose depression, and that in consequence you may be storing substantial amounts of sensitive personal information. Discuss this problem from the viewpoints of both data protection law and ethics. (a) Windows implements static inheritance for the access-control lists of NTFS files and folders. (i) What does static inheritance mean here and how does it differ from dynamic inheritance? [4 marks] (ii) Five flag bits (ci,oi,np,io,i) in each NTFS access-control entry (ACE) manage how it is inherited. Briefly describe the purpose of each bit. [5 marks] (iii) User mike gives his folder project the following access-control list: project AllowAccess mike: full-access (oi,ci) AllowAccess alice: read-execute (ci,np) AllowAccess bob: read-only (oi) It contains one folder and two text files, none of which have any noninherited access-control entries: project\doc.txt project\src project\src\main.c For each of these three objects, list all inherited access-control entries, showing in parentheses the inheritance-control flag bits that are set (using the same notation as above). [5 marks] (b) Describe the purpose and four typical functions of a root kit. (c) Suppose that S(a, b, . . .) and R(a, . . .) are relations (the notation indicates that attribute a is in the schema of both S and R, while attribute b is only in the schema of S). Suppose that v is a value; is the following equation always valid? (a=v or b=v) (R ./ S) = (a=v(R)) ./ (b=v(S)) If yes, provide a short proof. If no, provide a counter-example. [2 marks] (d) Various normal forms are important in relational schema design. (i) Define Third Normal Form (3NF). [3 marks] (ii) Define Boyce-Codd Normal Form (BCNF). [3 marks] (iii) For databases with many concurrent update transactions, explain why schemas in normal form are important for good performance. Data Structures and Algorithms (a) Describe and justify an algorithm for finding the shortest distance between each pair of vertices in an undirected graph in which each edge has a given positive length. If there is no path between a pair of vertices a very large result should arise. [12 marks] (b) Is it sensible to use your algorithm to discover whether such a graph is connected? Suggest an alternative that would be appropriate for a graph of 1000 vertices and 10,000 edges.

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

Step: 3

blur-text-image

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

Introduction to Algorithms

Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest

3rd edition

978-0262033848

More Books

Students also viewed these Programming questions

Question

Define failure. (p. 273)

Answered: 1 week ago