Skip to content

sasunts/Lowest-common-ancestor

Repository files navigation

Lowest Common-Ancestor

CS3012 Assignment

Task

  • Lowest Common Ancestor for a binary tree.
  • Choose a unit testing framework. A comprehensive by language list is available here.
  • Create a repository on a git service such as Github. Your work will be implemented in this repository.
  • Define a set of initial unit tests that capture the basic expected behaviour. This will require you to create sample data and also to identify the basic API for your solution.
  • Build your initial solution, testing it against your test code until it is working.
  • Refine the solution, expanding your test cases to deal with awkward parameters and edge cases that push the limits of your solution, enhancing your solution to deal with these.

My implementation

I have decided to implement the solution with the unit testing using Python. The main lca function has came from a resource online, tweaked to match what is needed. First test implemented. The Branch DAG contains new code to allow the solution to work on Directed acyclic graphs. in order to run the test you must be inside the Src then run the command pyhton .\test.py

Releases

No releases published

Packages

No packages published

Languages