Skip to content

gatesy/examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

examples

Lowest Common Ancestor (LCA)

An F# implementation of the lowest common ancestor problem. Provides 3 solutions:

  • With a parent pointer - build paths from the root to the nodes and find the lowest node where these paths overlap.
  • Without a parent pointer - build paths from the root using depth first search and then apply the first solution's algorithm
  • Without a parent pointer - search using a pruning heuristic: once we have found one of the nodes in the tree we don't need to consider any nodes below it, as the LCA must be either it or a node above it.

About

Solutions to various toy problems in F#

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages