Hostname: page-component-77f85d65b8-8wtlm Total loading time: 0 Render date: 2026-04-18T15:50:23.750Z Has data issue: false hasContentIssue false

Functional Pearls

Drawing trees

Published online by Cambridge University Press:  07 November 2008

Andrew J. Kennedy
Affiliation:
University of Cambridge Computer Laboratory, New Museums Site, Pembroke Street, Cambridge CB2 3QG, UK
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

This article describes the application of functional programming techniques to a problem previously studied by imperative programmers, that of drawing general trees automatically. We first consider the nature of the problem and the ideas behind its solution (due to Radack), independent of programming language implementation. We then describe a Standard ML program which reflects the structure of the abstract solution much better than an imperative language implementation. We conclude with an informal discussion on the correctness of the implementation and some changes which improve the algorithm's worst-case time complexity.

Information

Type
Articles
Copyright
Copyright © Cambridge University Press 1996
Submit a response

Discussions

No Discussions have been published for this article.