CS 580, Fall 2016; Instructor: Elena Grigorescu
TAs: Nima Darivandpour, Young-San Lin
Due: September 7, 4:30 pm in class, in typed hard copy
Problem set 1
Solve but do not turn in.
Problem 0 Review the slides with the proof of the structure of the solutio
10/11/2016
Arrays
Array Data Structure
Introduction
An array is an aggregate data structure that is designed to store a group of objects of the same or different
types. Arrays can hold primitives as well as references. The array is the most efcient data s
10/11/2016
Binary Trees
Binary Trees
Introduction
We extend the concept of linked data structures to structure containing nodes
with more than one self-referenced eld. A binary tree is made of nodes,
where each node contains a "left" reference, a "right"
Solution to question 2:
No.
Lets prove this by giving a contradicting example.
Suppose there are two men m1 and m2, & two women, w1 and w2. Their preference lists are as followsM1 = cfw_w1,w2
M2 = cfw_w2,w1
W1 = cfw_m2,m1
W2 = cfw_m1,m2
Here, the stable m
Home work 3
Solution to question 2:
a. We can look at the city as a directed graph G. With the roads as the edges m and the
intersections as nodes n.
We need to give an algorithm to check if the graph is strongly connected or not.
Algorithm:
1. Choose an