NETS 150 Homework 1
Due Feb 4, 2016 at 12.00pm
Part 1 Theory (20 points)
Please do the following problems:
1. Consider the graph shown below:
a. What is the in-degree and out-degree of each node? (2 points)
b. Show how Breadth-First Search wor

NETS150 Midterm
Graph: a way of representing relationships that exist between pairs of objects
Vertex (of a graph)/Nodes: Objects
Edge (of a graph)/Arc: Relationships
Degree (of a vertex): number of edges incident on the node
Path: sequence of alternating

Part 1: Theory
1. This statement is true. We can prove this by considering cases. The first two cases will be
if A or B are the starting node of the DFS. Case 1 is if the DFS starts with B, B will have
a starting time of 1. We know any finish time after t

Part 1:
1. What is a socket? What is the difference between a Socket object and a
ServerSocket object?
A socket is an endpoint of a two-way communication link between two
programs running on a network. It is bound to a port number. TCP is
used to identify

Part 2: Experimentation
1. We can choose the simple example representing how populations tend to self-segregate
even when not intentional. One way this is shown in the real world is with people of
different economic classes and their neighborhoods. In a n

Part 1 Theory
1.
a. 1: In-Degree of 2, Out-Degree of 1
2: In-Degree of 3, Out-Degree of 2
3: In-Degree of 1, Out-Degree of 2
4: In-Degree of 1, Out-Degree of 2
5: In-Degree of 2, Out-Degree of 1
6: In-Degree of 1, Out-Degree of 2
b. 2 1 4 5 3 6
c. 2 1 5 1

NETS150 Final
Adjacency list: collection of unordered lists used to represent a finite graph. Each list describes
the set of neighbors of a vertex in the graph.
Adjacency matrix: Square matrix used to represent a finite graph. The elements of the matrix
i

NETS HW#5 Theory
1. A)
Man
Women
L
L
NL
35, 35
45, 35
35, 45
50, 50
NL
B) The Best Response for the man would be NL if the women played NL, resulting in $50. The
Best Response for man would be NL if the women played L, resulting in $30. This means that th