-
Construct an instance of
Tree
from file, print its structure toSTDOUT
, and then write it back to file:import ardnew.Tree; public class BracketTest { public static void main(String[] args) { Tree<String> bracket = new Tree<String>(); if (bracket.readFile("/Users/andrew/brackettest/in.dat")) { bracket.print(); bracket.writeFile("/Users/andrew/brackettest/out.dat"); } } }
The
print()
routine looks liek:/-------[ node 31 /-------[ node 15 | \-------[ node 30 /-------[ node 7 | | /-------[ node 29 | \-------[ node 14 | \-------[ node 28 /-------[ node 3 | | /-------[ node 27 | | /-------[ node 13 | | | \-------[ node 26 | \-------[ node 6 | | /-------[ node 25 | \-------[ node 12 | \-------[ node 24 -------[ node 1 | /-------[ node 23 | /-------[ node 11 | | \-------[ node 22 | /-------[ node 5 | | | /-------[ node 21 | | \-------[ node 10 | | \-------[ node 20 \-------[ node 2 | /-------[ node 19 | /-------[ node 9 | | \-------[ node 18 \-------[ node 4 | /-------[ node 17 \-------[ node 8 \-------[ node 16
An incomplete tree also looks like you'd expect
-
Notifications
You must be signed in to change notification settings - Fork 0
binary tree library with flat-file database and ASCII pretty-printing
License
ardnew/bracket
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
binary tree library with flat-file database and ASCII pretty-printing
Topics
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published