Implementation for rigidity function with subsequence matching.
Let m be the number of left term atoms and n be the number of right term
atoms.
Time complexity = Exponential worst case (back tracking) but should be OK in
average case
Space complexity = O(m * n)
This implementation reuses all the allocated objects for performance reasons.
Implementation for rigidity function with substring matching.
Let m be the number of left term atoms and n be the number of right term
atoms.
Time complexity = O(m * n)
Space complexity = O(max(m, n))
This implementation reuses all the allocated objects for performance reasons.