|
The topic of this project is to solve five theoretical problems. The project should be done in groups of 2-3 people. The project should be documented in a report that is due Thursday November 22, 14.15, 2007.
Suppose that instead of least common ancestor queries in a static tree, we only need to answer ancestor-descendant queries: is node x an ancestor of a node y? Describe a simple space-efficient data structure supporting these queries in constant time.
Describe a data structure supporting the following three operations in worst-case constant time:
Describe a comparison based dictionary data structure that stores n elements. The data structure should support the two operations:
Show how to represent an undirected planar graph G=(V,E) in O(V) space such that queries "is (u,v) in E?" can be answered in constant time. (The solution should not use hashing.)
Suppose we are given a map consisting of a set of valleys in the Alps with high mountain passes connecting the valleys. We wish to plan a route from a starting valley to a destination valley, keeping the maximum altitude on the path as low as possible. It is known that an optimal solution to this problem can be found by computing a minimum spanning tree on a graph with one vertex per valley and one edge per pass, and following a path in this minimum spanning tree. We wish to design a data structure that can tell us the maximum altitude reached on the optimal path between any specified pair of valleys. Describe a space-efficient data structure that can answer queries in constant time per query.