【发布时间】:2020-05-27 22:24:31
【问题描述】:
我无法弄清楚这个头脑风暴算法问题!有人可以帮忙吗?
--------描述--------
假设您是一位正在寻找某种基因的科学家。你知道你是一个基因 寻找应该由以下块组成\
AT
GG
CTAC
我们将这些块称为“有效”。所有其他块都称为“无效”。现在给定一个由符号组成的基因
'A', 'G', 'C', 'T' 你应该确定给定的基因是否可以用有效的块形成。 可以使用有效块形成的基因示例:
GGATATCTAC
CTACGGGG
无法使用有效块形成的基因示例:
CCC
GGCAC
Question!
1. How many possible choice you have after each reduction?
2. Try to draw a recursion tree for this algorithm
3. What kind of data do you need to store after each reduction?
4. Try to write a recurrence relation for the running time of this algorithm.
5. Try to estimate the running time from the above recurrence relation. Is running time exponential or
polynomial in terms of n, the length of a gene?
【问题讨论】:
-
什么是
reduction?例子会很好。 -
构建 DFA
标签: algorithm backtracking text-segmentation