[Instructions] [Search] [Current] [News] [Syllabus] [Glance] [Links] [Handouts] [Project] [Outlines] [Labs] [Assignments] [Quizzes] [Exams] [Examples] [EIJ] [JPDS] [Tutorial] [API]
Back to Implementing Trees. On to Integration Discussion.
Held Wednesday, April 26, 2000
Overview
Today we will explore techinques used to print trees and convert trees to lists.
Notes
Contents
printdfs
printbfs
Summary
Interfaces:
Implementations:
Utilities:
A / \ B C / \ D E | F
TreePrinter
.
printOutline
to print?
printdfs
to print?
printbfs
to print?
printdfs
printdfs
that prints in postfix.
That is, a node should be printed after its children.
printdfs
that prints its
children in right-to-left order.
printbfs
printbfs
that prints its
children in right-to-left order.
Using printOutline
as a guide, write a method,
printWithEdges
that includes the edges in the
outline. For example, instead of
A B Q E T X Y Z Sit should print something more like the following
A +-B | +-Q | +-E +-T | +-X | | | +-Y | | | +-Z | +-S
Update the interfaces and the implementations to support
getSize
and getDepth
methods.
That is, each tree should be able to report on the number of elements
it contains and the number of levels it contains.
Tuesday, 18 January 2000
Tuesday, 25 April 2000
Wednesday, 26 April 2000
Back to Implementing Trees. On to Integration Discussion.
[Instructions] [Search] [Current] [News] [Syllabus] [Glance] [Links] [Handouts] [Project] [Outlines] [Labs] [Assignments] [Quizzes] [Exams] [Examples] [EIJ] [JPDS] [Tutorial] [API]
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
This page may be found at http://www.math.grin.edu/~rebelsky/Courses/CS152/2000S/Outlines/outline.47.html
Source text last modified Wed Apr 26 09:55:15 2000.
This page generated on Wed Apr 26 09:57:01 2000 by Siteweaver. Validate this page's HTML.
Contact our webmaster at rebelsky@grinnell.edu