CIS 121 - Fall 2011
Review for Midterm 1
For code fragments whose running time is a constant, do not give a specic number of steps, use
symbolic constants like c1 , c2 , etc. instead, or O(1).
Use thi
CIS 121 - Fall 2011
Midterm 2
NAME:
LAB SESSION:
1
2
3
4
5
6
7
15
20
15
10
15
15
10
Sum
100
The depth of a node is the nmber of links on the path from it to the root. The height of the tree is
the max
CIS 121 - Fall 2011
Review for Midterm 1
For code fragments whose running time is a constant, do not give a specic number of steps, use
symbolic constants like c1 , c2 , etc. instead, or O(1).
Use thi
CIS 121 - Fall 2011
SOLUTIONS - Midterm 1
1
(15 Points)
Sort the following running times so that f(n) is left from g(n) if f(n) is O(g(n) indicating whether
any two are to each other. No proof require
CIS 121 - Fall 2011
Review for Midterm 1
For code fragments whose running time is a constant, do not give a specic number of steps, use
symbolic constants like c1 , c2 , etc. instead, or O(1).
Use thi
CIS 121 - Fall 2011
Review for Midterm 1
For code fragments whose running time is a constant, do not give a specic number of steps, use
symbolic constants like c1 , c2 , etc. instead, or O(1).
Use thi
CIS 160 - Fall 2012
(instructor Val Tannen)
Mock Midterm 2 SOLUTIONS
Posted Tuesday October 30, 2012
1. (30 pts) For each statement below, decide whether it is true or false. In each case attach a ver
CIS 121 - Fall 2011 - Practice Quiz - max 50pts
1
(10 Points)
(a) There exist DAGs with two or more vertices which are strongly connected, true or false?
Solution: FALSE. If there are two distinct ver
CIS 121 - Fall 2011 - Practice Quiz - max 50pts
1
(10 Points)
(a) There exist DAGs with two or more vertices which are strongly connected, true or false?
.
(b) A tree can be also regarded as a digraph