Skip to content

Assignment for Software Engineering, creates a binary tree of numbers and finds the lowest common ancestor of 2 elements

Notifications You must be signed in to change notification settings

JayCowan/lca_sweng

Repository files navigation

Binary Trees and Directed Acyclic Graphs with Lowest Common Ancestor

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.

Steps to Test:

  1. Install the Dart SDK and command line tools from here
  2. From the terminal open to the lca_sweng directory
  3. Run the dart test command to view test results of both the Binary Tree and Directeed Acyclic Graph tests

Steps to Run (Note that this is for Binary Trees):

  1. Open a terminal to the lca_sweng directory.
  2. From the terminal enter dart run
  3. Follow instructions to build your tree and find a Lowest Common Ancestor

Click here to view the docs.

About

Assignment for Software Engineering, creates a binary tree of numbers and finds the lowest common ancestor of 2 elements

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages