我在 Saurabh Kr Vats 在http://www.careercup.com/question?id=14990323提出的解决方案中遇到了这个问题
他说:
# Finally, the sequence could be "rho-shaped." In this
# case, the sequence looks something like this:
#
# x_0 -> x_1 -> ... x_k -> x_{k+1} ... -> x_{k+j}
# ^ |
# | |
# +-----------------------+
#
# That is, the sequence begins with a chain of elements that enters a cycle,
# then cycles around indefinitely. We'll denote the first element of the cycle
# that is reached in the sequence the "entry" of the cycle.
我在网上搜索并达到了循环检测。当我们到达一个循环的开始/结束并尝试去一个不相邻的元素时,我可以看到形成 rho 形状。然而,我不理解序列的表示或其用法。
如果有人可以举例说明,那就太好了。