[北美] (CS)想請教面試時可以用自備的library嗎?
例如說像這個問題: http://www.careercup.com/question?id=14711684
Write the code to find lexicographic minimum in a circular array,
e.g. for the array BCABDADAB, the lexicographic mininum is ABBCABDAD.
一個可能的 Linear time algorithm: (copy from CareerCup)
Given string S.
For String S' = SS (append S to itself).
Compute suffix tree (ST) of S'.
Now do a depth first search of ST,
picking the children in lexicographic order.
Pick the first node you find, at depth |S|.
建 suffix tree 可以在 linear time 做到,
不過像 Java 本身的 library 似乎不包含建 suffix tree,
要在不到一個小時的時間 implement 建 suffix tree 的 function,
至少對我而言應該做不到 Orz...
這種情況是否一定要想出其它的解法,
可以跟 interviewr 說假設已經有個建 suffix tree 的 function,
然後 balabala... 嗎? 有機會被接受嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.243.4.124
推
03/10 03:46, , 1F
03/10 03:46, 1F
→
03/10 21:56, , 2F
03/10 21:56, 2F
推
03/12 22:29, , 3F
03/12 22:29, 3F
→
03/12 22:30, , 4F
03/12 22:30, 4F
→
03/12 22:31, , 5F
03/12 22:31, 5F
→
03/12 22:31, , 6F
03/12 22:31, 6F
→
03/12 22:32, , 7F
03/12 22:32, 7F
→
03/12 22:33, , 8F
03/12 22:33, 8F
→
03/12 22:34, , 9F
03/12 22:34, 9F
→
03/12 22:35, , 10F
03/12 22:35, 10F
→
03/12 22:36, , 11F
03/12 22:36, 11F
→
03/12 22:36, , 12F
03/12 22:36, 12F
→
03/12 22:37, , 13F
03/12 22:37, 13F
推
03/12 22:42, , 14F
03/12 22:42, 14F
→
03/12 22:42, , 15F
03/12 22:42, 15F
→
03/14 18:12, , 16F
03/14 18:12, 16F