Abstract
After having taught the design of algorithms for more than ten years I still find that recursive algorithms are much too difficult for most computer science students. There seem to be two problems: the students are unable to grasp the essence of an algorithm in a recursive setting, and they rarely have any knowledge of the mechanisms underlying recursive calls.
In view of the above it was thought useful to translate a number of recursive algorithms into nonrecursive form for classroom use. Tarjan's depth-first search algorithms for digraphs (4,5) were selected because they are sufficiently important to require their study in some computer science course or other. The translation consists of making the depth-first search tree of the digraph explicit, and letting tree traversals take over the role of recursion. The nonrecursive algorithm for topological ordering of an acyclic digraph will be our example here. This algorithm is used to preprocess a scheduling network before it is subjected to critical path analysis.
- 1 Jackson, G.A. A graphical technique for describing recursion. Proc. ACM SIGCSE Sixth Tech.Symp.Comp.Sci.Education (SIGCSE Bull. 8, No. 3 (Sept.1976)), pp. 30-32. Google Scholar
Digital Library
- 2 Wirth,N. Algorithms + Data Structures &equil; Programs. Prentice-Hall, Englewood Cliffs, N.J., 1976. Google Scholar
Digital Library
- 3 Dijkstra,E.W. Correctness concerns and, among other things, why they are resented. Proc. 1975 International Conf. Reliable Software (SIGPLAN Notices 10, No.6 (June 1975)), pp.546-550. Google Scholar
Digital Library
- 4 Tarjan, R. Depth-first search and linear graph algorithms. SIAM J. comput. 1 (1972) 146-159.Google Scholar
- 5 Tarjan, R. Finding dominators in directed graphs. SIAM J. Comput. 3 (1974), 62-89.Google Scholar
Digital Library
- 6 Berztiss, A.T. K-tree algorithms for critical path analysis. To be published. (Available as a report from the author.)Google Scholar
- 7 Knuth, D.E. The Art of Computer Programming Vol.1: Fundamental Algorithms, 2nd Ed. Addison-Wesley, Reading, Mass., 1973. Google Scholar
Digital Library
- 8 Berztiss,A.T. Data Structures: Theory and Practice, 2nd Ed. Academic Press, New York, 1975. Google Scholar
Digital Library
Index Terms
Depth-first digraph algorithms without recursion
Recommendations
Depth-first digraph algorithms without recursion
SIGCSE '77: Proceedings of the seventh SIGCSE technical symposium on Computer science educationAfter having taught the design of algorithms for more than ten years I still find that recursive algorithms are much too difficult for most computer science students. There seem to be two problems: the students are unable to grasp the essence of an ...
Smallest number of vertices in a 2-arc-strong digraph without good pairs
AbstractBranchings play an important role in digraph theory and algorithms. In particular, a chapter in the monograph of Bang-Jensen and Gutin, Digraphs: Theory, Algorithms and Application, Ed. 2, 2009 is wholly devoted to branchings. The well-...
Highlights- The study of good pair has relations with Tutte's Packing Theorem and Edmonds Branching Theorem.






Comments