CS 507 - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

CS 507

Description:

b. A binary search tree(BST) with nodes has edges. a. The degree of a binary tree can be 0 or 1. ... tree, draw the final BST after these 2 operations: insert ... – PowerPoint PPT presentation

Number of Views:731
Avg rating:3.0/5.0
Slides: 22
Provided by: Scha89
Category:
Tags: bst

less

Transcript and Presenter's Notes

Title: CS 507


1
CS 507 Mathematical Methods in Computer Science
Final Exam
Prof. Sung-Hyuk Cha
Spring of 2004
School of Computer Science Information Systems
2
Print Your Name
3
1. How many bit strings are there of length six
or less?
4
2. Find the least number of cables required to
connect eight computers to four printers to
guarantee that four computers can directly access
four different printers.
5
  • How many permutations are there of the set
  • a, b, c, d, e, f, g.

6
4. How many bit strings of length 12 contain at
least three 1s?
7
5. Find the coefficient of in
8
6. What is the probability that a card selected
from a deck is an ace or a heart?
9
7. What is the probability that a five-card
poker hand contains exactly one ace?
10
8. What is the probability of the event that 1
precedes 3 when we randomly select a permutation
of 1, 2, 3?
11
9-10. Suppose that we roll a die until a 6 comes
up. 9 What is the probability that we roll the
die n times? 10 What is the expected number
of times we roll the die?
12
11. Which of the following (s) is (are) true?
a. The degree of a binary tree can be 0 or 1.
b. A binary search tree(BST) with nodes has
edges.
c. A tree with n nodes has exactly n -1 edges
d. The following postfix expression is true
4 7 3 - / 2 -2
13
12. Is this tree a binary search tree?
14
13. Build a binary search tree for be not
ashamed of mistakes and thus make them crimes.
15
14. Given a binary search tree, draw the final
BST after these 2 operations insert 6 and
next insert 8.
16
15. How many vertices and how many leaves does a
complete m-ary tree of height h have?
17
16. Given a graph, select all valid topological
sorted lists.
1
2
  • (1 3 5 4 6 2)
  • (1 4 3 5 6 2)
  • (5 1 4 3 6 2)
  • (5 3 1 4 6 2)

6
3
4
5
17. Given a graph how many nodes have their
degree 2?
1
2
6
3
4
5
18
18. Consider a directed unweighted graph
represented in an adjacent list. Show the graph
with the shortest path where 0 node is the source.
0
5
4
1
1
2
2
3
3
5
6
4
0
3
5
3
6
2
1
19
(No Transcript)
20
19. Represent adjacency matrix using graph.
a
b
c
d
21
20. Consider a directed weighted graph, show the
graph with the shortest path where node is
the source.
3
1
1
10
4
25
2
8
3
2
11
1
Write a Comment
User Comments (0)
About PowerShow.com