(CS)想請教面試時可以用自備的library嗎? - 面試
By Blanche
at 2013-03-09T19:19
at 2013-03-09T19:19
Table of Contents
例如說像這個問題: 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... 嗎? 有機會被接受嗎?
--
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... 嗎? 有機會被接受嗎?
--
Tags:
面試
All Comments
By Vanessa
at 2013-03-12T13:22
at 2013-03-12T13:22
By Audriana
at 2013-03-13T21:06
at 2013-03-13T21:06
By Ingrid
at 2013-03-15T17:57
at 2013-03-15T17:57
By Eden
at 2013-03-17T02:58
at 2013-03-17T02:58
By Candice
at 2013-03-20T12:41
at 2013-03-20T12:41
By Poppy
at 2013-03-22T22:15
at 2013-03-22T22:15
By James
at 2013-03-26T01:17
at 2013-03-26T01:17
By Queena
at 2013-03-29T02:43
at 2013-03-29T02:43
By Olga
at 2013-03-30T04:20
at 2013-03-30T04:20
By Harry
at 2013-04-03T01:54
at 2013-04-03T01:54
By Zanna
at 2013-04-07T06:09
at 2013-04-07T06:09
By William
at 2013-04-11T20:23
at 2013-04-11T20:23
By Frederic
at 2013-04-13T18:33
at 2013-04-13T18:33
Related Posts
大家有沒有接到日本BCG最終面試通知
By Olga
at 2013-03-08T19:28
at 2013-03-08T19:28
徵成功獲得面試通知的英文履歷resume
By Donna
at 2013-03-07T08:21
at 2013-03-07T08:21
想請教這份上海工作
By Zora
at 2013-03-06T13:36
at 2013-03-06T13:36
想請教 Google Interview 要注意的事項
By Candice
at 2013-03-06T06:41
at 2013-03-06T06:41
想請教 Google Interview 要注意的事項
By Edward Lewis
at 2013-03-06T03:14
at 2013-03-06T03:14