Rosalind第90题:Phylogeny Comparison with Split Distance

Problem

Define the split distance between two unrooted binary trees as the number of nontrivial splits contained in one tree but not the other.

Formally, if  denotes the number of nontrivial splits shared by unrooted binary trees  and , Then their split distance is .

Given: A collection of at most 3,000 species taxa and two unrooted binary trees  and  on these taxa in Newick format.

Return: The split distance .

将两棵无根二叉树之间的分割距离定义为一棵树而不是另一棵树中包含的非平凡分割的数目。

正式地,如果  表示无根二叉树共享的非平凡拆分的数量  和 ,则它们的分割距离为 。

给出:最多可收集3,000种分类单元和两棵无根二叉树的集合 和  以Newick格式在这些分类单元上。

返回:分割距离

Sample Dataset

dog rat elephant mouse cat rabbit
(rat,(dog,cat),(rabbit,(elephant,mouse)));
(rat,(cat,dog),(elephant,(mouse,rabbit)));

Sample Output

2
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值