zheng lab也火了~ (转载)# Joke - 肚皮舞运动
r*r
1 楼
网上看到这个 UIUC 的期末考试题,
“Describe and analyze an algorithm to find the longest prefix of a given
string that is also a palindrome. For example, the longest palindrome prefix
of ILLINOISURBANACHAMPAIGN is ILLI, and the longest palindrome prefix of
HYAKUGOJYUUICHI is the single letter S.
For full credit, your algorithm should run in O(n) time.
”
这个题目中是不是有个笔误,其中 "HYAKUGOJYUUICHI" 的 longes prefix 为什么是 S
? 原题在这里:http://theory.cs.uiuc.edu/~jeffe/teaching/algorithms/hwex/s01/final.pdf
应该是 H 吧?
“Describe and analyze an algorithm to find the longest prefix of a given
string that is also a palindrome. For example, the longest palindrome prefix
of ILLINOISURBANACHAMPAIGN is ILLI, and the longest palindrome prefix of
HYAKUGOJYUUICHI is the single letter S.
For full credit, your algorithm should run in O(n) time.
”
这个题目中是不是有个笔误,其中 "HYAKUGOJYUUICHI" 的 longes prefix 为什么是 S
? 原题在这里:http://theory.cs.uiuc.edu/~jeffe/teaching/algorithms/hwex/s01/final.pdf
应该是 H 吧?