hw2 - S ⊆ A having odd cardinality is 2 n-1 Prove your...

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

View Full Document Right Arrow Icon
MCS4653, Theory of Computation Homework Assignment 2, Due 9/22/03 Name Student ID Page 1 1. (GRE Problem 5, Page 13) A procedure that printed this binary tree in postorder would produce what output? D E B F C A 2. (GRE Problem 6, Page 14) Which one of the following is Not a binary search tree. Why? 2 4 3 7 5 2 3 6 7 5 2 3 4 5 3 4 7 6 5 3 6 4 7 5 3. (GRE Problem 15, Page 19) An integer c is a common divisor of two integers x and y if and only if c is a divisor of x and c is a divisor of y . Which of the following sets of integers could possibly be the set of all common divisors of two integers? Explain your answer. a) {- 6 , - 2 , - 1 , 1 , 2 , 6 } b) {- 6 , - 2 , - 1 , 0 , 1 , 2 , 6 } c) {- 6 , - 3 , - 2 , - 1 , 1 , 2 , 3 , 6 } d) {- 6 , - 3 , - 2 , - 1 , 0 , 1 , 2 , 3 , 6 } e) {- 6 , - 4 , - 3 , - 2 , - 1 , 1 , 2 , 3 , 4 , 6 }
Background image of page 1

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

View Full Document Right Arrow Icon
MCS4653, Theory of Computation Homework Assignment 2, Due 9/22/03 Name Student ID Page 2 4. (GRE Problem 41, Page 34) Let A be a finite, nonempty set with cardinality n. Show the number of subsets
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: S ⊆ A having odd cardinality is 2 n-1 . Prove your answer by induction. 5. (GRE Problem 69, Page 46) Let T denote a nonempty binary tree in which every node is a leaf or has two children. Then n ( T ) denotes the number of non-leaf nodes of T (where n ( T ) = 0 if T is a leaf), h ( T ) denotes the height of T (where h ( T ) = 0 if T is a leaf), T L denotes the left subtree of T and T R denotes the right subtree of T . If F is a function defined by F ( T ) = ‰ if T is a leaf F ( T L ) + F ( T R ) + min( h ( T L ) ,h ( T R )) otherwise then show F ( T ) = n ( T )-h ( T ) by induction....
View Full Document

{[ snackBarMessage ]}

Page1 / 2

hw2 - S ⊆ A having odd cardinality is 2 n-1 Prove your...

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