Fall05Hw2

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

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

View Full Document Right Arrow Icon
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. Graph 1: V={a, b, c}, E={(a,b), (a, c), (b, c)}
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/10/2012 for the course CSE 5211 taught by Professor Dmitra during the Spring '12 term at FIT.

Page1 / 2

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

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online