Consider a directed graph in which the only negative edges are… Consider a directed graph in which the only negative edges are those that
Consider a directed graph in which the only negative edges are… Consider a directed graph in which the only negative edges are those that leave s; all other edgesare positive. Can Dijkstra’s algorithm, started at s, fail on such a graph? Prove your answer.4.10. You are given a directed graph with (possibly negative) weighted edges, in which the shortestpath between any two vertices is guaranteed to have at most k edges. Give an algorithm thatfinds the shortest path between two vertices u and v in O(k|E|) time.4.11. Give an algorithm that takes as input a directed graph with positive edge lengths, and returnsthe length of the shortest cycle in the graph (if the graph is acyclic, it should say so). Youralgorithm should take time at most O(|V |3).4.12. Give an O(|V |2) algorithm for the following task.Input: An undirected graph G = (V, E); edge lengths le > 0; an edge e ? E.Output: The length of the shortest cycle containing edge e.4.13. You are given a set of cities, along with the pattern of highways between them, in the form of anundirected graph G = (V, E). Each stretch of highway e ? E connects two of the cities, and youknow its length in miles, le. You want to get from city s to city t. There’s one problem: your carcan only hold enough gas to cover L miles. There are gas stations in each city, but not betweencities. Therefore, you can only take a route if every one of its edges has length le ? L.(a) Given the limitation on your car’s fuel tank capacity, show how to determine in linear timewhether there is a feasible route from s to t.(b) You are now planning to buy a new car, and you want to know the minimum fuel tankcapacity that is needed to travel from s to t. Give an O((|V | + |E|) log |V |) algorithm todetermine this.4.14. You are given a strongly connected directed graph G = (V, E) with positive edge weights alongwith a particular node v0 ? V . Give an efficient algorithm for finding shortest paths between allpairs of nodes, with the one restriction that these paths must all pass through v0.4.15. Shortest paths are not always unique: sometimes there are two or more different paths with theminimum possible length. Show how to solve the following problem in O((|V | + |E|) log |V |) time.Input: An undirected graph G = (V, E); edge lengths le > 0; starting vertex s ? V .Output: A Boolean array usp[·]: for each node u, the entry usp[u] should be true ifand only if there is a unique shortest path from s to u. (Note: usp[s] = true. Software systems often incorporate structural representations of the applicationdomain in which they operate. For example, a vehicle control system should beaware of the fact that the car has precisely four wheels. This kind of informationmust be captured, encoded and tested at each stage of the software design process.Using the number of wheels in a car as a simple example, describe relevant designactivities and products at each of the following phases of a software project:(a) inception; [4 marks](b) elaboration; [4 marks](c) construction; [4 marks](d) transition; [4 marks](e) system operation. [4 marks]8 Regular Languages and Finite Automata(a) Explain what is a context-free grammar and the language it generates.[4 marks](b) What does it mean for a context-free grammar to be regular? Given anydeterministic fifinite automaton M, describe a regular context-free grammarthat generates the language of strings accepted by M. [4 marks](c) Construct a non-deterministic fifinite automaton with ?-transitions whoselanguage of accepted strings is equal to the language over the alphabet {a, b, c}generated by the context-free grammar with non-terminals q0 and q1, whosestart symbol is q0 and whose productions are q0 ? abq1, q1 ? ?, q1 ? q0 andq1 ? abc. [4 marks](d) Is every language generated by a context-free grammar equal to theset of strings accepted by some non-deterministic fifinite automaton with?-transitions? Justify your answer. (Any standard results about regularlanguages you use should be carefully stated, but need not be proved.)[8 marks]7 (TURN OVER)CST.2008.2.89 Professional Practice and Ethics(a) The British Computer Society Code of Conduct has four sections. What kindof professional conduct does each section cover, and how does each of thesekinds of conduct benefifit the profession and its members? [8 marks](b) True or False questions:(i) A User can provide occasional use of the University computer system fora friend who is a temporary visitor.(ii) Circumstances that mitigate minor infractions of the rules promulgatedby the Information Technology Syndicate include, among other things,inebriation.(iii) Appropriate use of the Cambridge University Data Network (CUDN)means bona fifide academic activity plus a low level for private purposes.(iv) Small amounts of commercial activity are acceptable as long as the Useris acting in a private capacity.[4 marks](c) The IT industry is increasingly aware of its own environmental impact.Describe at least one environmental problem to which the industry contributesand how, as an IT professional, you can help to solve this problem. [4 marks](d) “Social engineering is a greater threat to computer security than computercracking software.” What is social engineering and what measures can betaken to guard against it? [2 marks] Image transcription text4. (10 points) The set of full binary treesis defined recursively in Definition 5 onpage 353: (1.) Basis step: … Show more… Show more Computer Science Engineering & Technology Information Security CMPE MISC Share QuestionEmailCopy link


