The command-line application written in dart lets you enter binary trees of nums
(but would work for any type implementing Comparable<T>
). The trees are split by relative value where left < parent and right >= parent in order of input.
The Binary Tree should work for any type implementing Comparable<T>
but has been tested for types inheriting num
.
The Directed Acyclic Graph (DAG) should accept any object, including dynamic
and Object
, so it is possible to mix different objects within the same graph.
- Install the Dart SDK and command line tools from here
- From the terminal open to the lca_sweng directory
- Run the
dart test
command to view test results of both the Binary Tree and Directeed Acyclic Graph tests
- Open a terminal to the lca_sweng directory.
- From the terminal enter
dart run
- Follow instructions to build your tree and find a Lowest Common Ancestor
Click here to view the docs.