COP3530SampleQuiz2 - COP 3530 CS3 15 1. Fall 1999 Quiz # 2...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
COP 3530 – CS3 Fall 1999 Quiz # 2 Name:__ Sample Quiz _________ 15 1. Consider the following trees being used to represent equivalence classes ( partitions ) over the set {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16} . Show the resulting combination of the first two trees if we do a union(2,3) . Now show the final tree the results after we do a union(6,16) . In each case, assume that the union starts with two finds , each of which uses path compression and that the unions use tree heights to minimize path lengths . 4 6 2 8 5 1 3 7 9 14 11 13 16 12 15 10 Define the function lg* N (also called log 2 *(N) ). What is the value of lg* 2 16 ? How does lg* N relate to the management of partition trees by the above algorithms? 10 2. The following table shows algorithmic costs for naive approaches (ones not involving sorts or indices) to relational operations. Fill in the columns associated with the use of indices . You may assume constant time index lookup via a hash table. Assume |R| = n , |S| = m , t = n+m , and |Result| = k Naive Indexed R S n × m R – S n × m σ C (R) n π (R) n^2 R S n × m 10 3. An undirected graph can be checked to see if it’s connected by using a union/find algorithm, similar to Kruskal’s tree spanning algorithm (see #7 ), or by employing depth first search . In words, describe how the depth first search algorithm solves this problem. You may assume a graph G
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 06/13/2011.

Page1 / 5

COP3530SampleQuiz2 - COP 3530 CS3 15 1. Fall 1999 Quiz # 2...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online