{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Fall05Hw2

Fall05Hw2 - HomeWork 2 Algorithms Points 25(UG/35(Grad CSE...

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

HomeWork 2 Algorithms CSE 4081/5211 Fall 2005 Points 25 (UG) /35 (Grad): Due: 9/20/05, Tuesday 1. Algorithm tracing [Points 15]: Implement the two Topological Sort algorithms (Naïve and Q-based). Implementations must use adjacency list as the graph data structure. Print the identifier for a node whenever it is looked up in the algorithm. Specifically in my algorithms: (In Naïve Topo-sort) Print each node when its indegeree is initially calculated; each node when it is checked for its indegree in the loop for “ v = a vertex with zero indegree;” and each node w before the line “decrement indegree of w by 1;” (In Q-based Topo-Sort) Print each node v when its indegeree is calculated before line “calculate indegree(v);” each node v after it is dequed in line “ v = dequeue from the head of Q ;” each node w before line “decrement indegree of w ;” Run your implementations over the following three input directed graphs.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 2

Fall05Hw2 - HomeWork 2 Algorithms Points 25(UG/35(Grad CSE...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online