Fall 1995 CS Master's Examinations
This test is in-class, closed book and closed notes. There are 6 groups of two questions each; you are to solve one question in each group. (The groups are simply questionsfor
.) \ You have 3 hours to complete the exam, which translates into 30 minutes per question.
-
(Algorithms/Data Structures) \
Consider the following algorithm for traversing a graph (directed or
undirected) from a given start vertex v. The algorithm uses a queue
with the ordinary
Create(),Add(),Remove(), andIsEmpty()operations.
Assuming an adjacency list representation of the graph, do a worst-case analysis (time and space) of this algorithm. Note that this is not a standard breadth-first search traversal of the graph: how does it differ from one and what can you do to turn it into a standard breadth-frist search?
-
(Algorithms/Data Structures) \
Consider the following C-like functions.
- Ignoring arithmetic precision, what is an exact closed form for f(n) as a function of n?
- Again ignoring arithmetic precision, what is the time complexity of f(n) as a function of n?
- How can the running time of this computation be improved significantly?
-
(Theory of Computation)
Give a deterministic finite automaton that accepts the set of all strings over
such that
(i) the string has no leading 0s; and
(ii) when considered as an integer, the string represents a multiple of 3.
(The language consists of the strings
, 11, 110, 1001, 1100, 1111, 10010, 10101, etc.)
-
(Theory of Computation) \
What is wrong with this reduction from G3C (graph 3-colorability)
to Minimum Vertex-Deletion Bipartite Subgraph (delete at most K
vertices such that the resulting graph is bipartite)?
-
Given an instance of G3C, i.e., a graph G=(V,E), just let the instance
of MVDBS be G itself, with bound
.
-
Given an instance of G3C, i.e., a graph G=(V,E), just let the instance
of MVDBS be G itself, with bound
- (Operating systems) \ Assume that an operating system uses a typical paging system. Describe the steps that the system must take (in terms of the virtual memory subsystem) for each of these four events: process creation, process dispatch, page fault in a process, and process destruction.
-
(Operating systems) \
A file system must, for each file, keep track of which blocks on disk contain
the file data; this information is used in mapping logical block numbers to
physical block numbers.
- What are logical and physical block numbers (in a single file)? What do we mean by mapping logical block numbers to physical block numbers?
- What is an indirect block in this context? a double indirect block?
- Make (and state) some reasonable assumptions about the disk system and figure out how many blocks would be mapped by a double indirect block.
- (Languages) \ Write a Lisp function that will traverse an arbitrary rooted, ordered tree in inorder. Define your own representation of trees as s-expressions.
-
(Languages) \
What is ``currying'' in Scheme? Give a definition of a function
currythat will curry any function of two arguments. Usecurryandmapcarto write a function that adds 5 to each item in a list. - (Software Engineering) \ Suppose that a word-processing system is to have the capability to create mathematical expressions (with square root signs, fractions, exponents, integrals, etc). Use this problem to illustrate the three stages of requirements, specifications, and architectural (high-level) design, clearly distinguishing between the three.
- (Software Engineering) \ What is regression testing? What is black box testing? What is white box testing? \ Explain the differences between unit testing, integration testing and acceptance testing.
- (Formal Specifications) \ Using any formal specification system you want, write a formal specification for a function that returns the greatest common divisor of two positive integers.
-
(Formal Specifications) \
Write a meaningful invariant for this loop; of what use is your invariant?
for( i=0 ; i<n ; i++ ) { if (x > arr[i]) arr[i] = x }
