Skip to content

Commit

Permalink
Update LCA.md (#126)
Browse files Browse the repository at this point in the history
Change Vertabrate into Vertebrate
  • Loading branch information
squenson1 authored Jan 2, 2024
1 parent 1bccb92 commit fa052f9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions content/algorithms/lca/LCA.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ Let's first draw the tree using NetworkX.
T = nx.DiGraph()
T.add_edges_from(
[
("Vertabrate", "Lamprey"),
("Vertabrate", "Jawed V."),
("Vertebrate", "Lamprey"),
("Vertebrate", "Jawed V."),
("Jawed V.", "Sunfish"),
("Jawed V.", "Tetrapod"),
("Tetrapod", "Newt"),
Expand Down Expand Up @@ -80,12 +80,12 @@ Consider the tree above and observe the following relationships:

- Ancestors of node Mammal:
- For this, we will follow the path from root to node Mammal.
- Nodes Vertabrate, Jawed Vertabrate, Tetrapod and Amniote -which are on this path- are ancestors of Mammal.
- Nodes Vertebrate, Jawed Vertebrate, Tetrapod and Amniote -which are on this path- are ancestors of Mammal.
- Descendants of node Mammal:
- Bear and Chimpanzee are the child of Mammal. Thus, they are its descendants.
- Lowest Common Ancestor of Mammal and Newt:
- Ancestors of Mammal are Vertabrate, Jawed Vertabrate, Tetrapod and Amniote.
- Ancestors of Newt are Vertabrate, Jawed Vertabrate, and Tetrapod.
- Ancestors of Mammal are Vertebrate, Jawed Vertebrate, Tetrapod and Amniote.
- Ancestors of Newt are Vertebrate, Jawed Vertebrate, and Tetrapod.
- Among the common ancestors, the lowest (i.e. farthest away from the root) one is Tetrapod.

_Note that, in terms of lowest common ancestor algorithms, every node is considered as an ancestor itself._
Expand Down

0 comments on commit fa052f9

Please sign in to comment.