skip to main content
article
Free Access

Depth-first digraph algorithms without recursion

Published:01 February 1977Publication History
Skip Abstract Section

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 2 Wirth,N. Algorithms + Data Structures &equil; Programs. Prentice-Hall, Englewood Cliffs, N.J., 1976. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4 Tarjan, R. Depth-first search and linear graph algorithms. SIAM J. comput. 1 (1972) 146-159.Google ScholarGoogle Scholar
  5. 5 Tarjan, R. Finding dominators in directed graphs. SIAM J. Comput. 3 (1974), 62-89.Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 6 Berztiss, A.T. K-tree algorithms for critical path analysis. To be published. (Available as a report from the author.)Google ScholarGoogle Scholar
  7. 7 Knuth, D.E. The Art of Computer Programming Vol.1: Fundamental Algorithms, 2nd Ed. Addison-Wesley, Reading, Mass., 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 8 Berztiss,A.T. Data Structures: Theory and Practice, 2nd Ed. Academic Press, New York, 1975. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Depth-first digraph algorithms without recursion

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM SIGCSE Bulletin
          ACM SIGCSE Bulletin  Volume 9, Issue 1
          Special issue seventh technical symposium on computer science education
          Feb 1977
          187 pages
          ISSN:0097-8418
          DOI:10.1145/382063
          Issue’s Table of Contents
          • cover image ACM Conferences
            SIGCSE '77: Proceedings of the seventh SIGCSE technical symposium on Computer science education
            February 1977
            187 pages
            ISBN:9781450374071
            DOI:10.1145/800104

          Copyright © 1977 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 1 February 1977

          Check for updates

          Qualifiers

          • article
        • Article Metrics

          • Downloads (Last 12 months)26
          • Downloads (Last 6 weeks)2

          Other Metrics

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!