码迷,mamicode.com
首页 >  
搜索关键字:interview    ( 649个结果
[LeetCode] String Reorder Distance Apart
Question:Givenastringoflowercasecharacters,reorderthemsuchthatthesamecharactersareatleastdistancedfromeachother.Input:{a,b,b},distance=2Output:{b,a,b}http://leetcode.com/2010/05/here-is-another-google-phone-interview.htmlpublicvoidreorder(int[]A,intd) { //S..
分类:其他好文   时间:2015-01-18 15:51:15    阅读次数:170
[Twitter] Max Stack
Question:Designamaxstackusingonestack.?Onestack?Ithinkitistwostacks.classMaxMinStack<T> { privateStack<T>data; privateStack<T>max; privateStack<T>min; privateComparator<T>comparator; publicMaxMinStack<T>(Comparatorcompar..
分类:其他好文   时间:2015-01-16 17:06:08    阅读次数:185
[Twitter] Fibonacci Sequence
Question:Givenanumbern,givemeafunctionthatreturnsthenthfibonaccinumber.Runningtime,spacecomplexity,iterativevs.recursive.http://www.glassdoor.com/Interview/Given-a-number-n-give-me-a-function-that-returns-the-nth-fibonacci-number-Running-time-space-complexi..
分类:其他好文   时间:2015-01-16 17:06:01    阅读次数:105
[Twitter] Generate chars and *
Question:Givenalistofstring,like(a,b,c),returnalist:(*,*,*),(a,*,*),(*,b,*),(*,*,c),(a,b,*),(a,*,c),(*,b,c),(a,b,c).//NP publicList<List<String>>generate(List<String>str) { //Validations... List<String>cur=newArrayList<>(str.s..
分类:其他好文   时间:2015-01-16 16:57:41    阅读次数:229
[Twitter] All possible pickings
Question:Givennsetsofchoices:(1,2,3),(a,b,c),(i,ii,iii).Youpickoneelementfromeachsetofchoices.Generateallpossiblepickings.http://www.glassdoor.com/Interview/Given-n-sets-of-choices-1-2-3-2-3-4-4-5-You-pick-one-element-from-each-set-of-choices-Generate-all-p..
分类:其他好文   时间:2015-01-16 08:46:43    阅读次数:194
[Twitter] Divide Without / Or %
Question:ImplementIntegerdivisionwithoutusing/or%.http://www.glassdoor.com/Interview/Implement-integer-division-without-using-or-Questions-about-running-time-Can-you-do-it-faster-QTN_250205.htm //Abinaryquestion //returna/b. publicintdivide(inta,intb) { if(..
分类:其他好文   时间:2015-01-16 08:45:05    阅读次数:154
[Twitter] Lowest Level Common Ancestor
Question:Inabinaryintegervaluetree,findthelowestlevelcommonancestoroftwovalues.http://www.glassdoor.com/Interview/In-a-binary-integer-value-tree-find-the-lowest-level-common-ancestor-of-two-values-QTN_219955.htm//classTreeNode{ //intval; //TreeNodeleft; //T..
分类:其他好文   时间:2015-01-16 08:44:40    阅读次数:190
[LintCode] Rehashing
http://lintcode.com/en/problem/rehashing/#/** *DefinitionforListNode *publicclassListNode{ *intval; *ListNodenext; *ListNode(intx){ *val=x; *next=null; *} *} */ publicclassSolution{ /** *@paramhashTable:AlistofThefirstnodeoflinkedlist *@return:AlistofThefir..
分类:其他好文   时间:2015-01-14 18:16:17    阅读次数:211
[LintCode] Compare Strings
http://lintcode.com/en/problem/compare-strings/publicclassSolution{ /** *@paramA:AstringincludesUpperCaseletters *@paramB:AstringincludesUpperCaseletter *@return:ifstringAcontainsallofthecharactersinBreturntrueelsereturnfalse */ publicbooleancompareStrings(..
分类:其他好文   时间:2015-01-14 18:11:48    阅读次数:145
[LintCode] Kth Prime Number
http://lintcode.com/en/problem/kth-prime-number/#classSolution{ /** *@paramk:Thenumberk. *@return:Thekthprimenumberasdescription. */ publiclongkthPrimeNumber(intk){ //writeyourcodehere Queue<Long>q3=newLinkedList<>(); q3.offer(3L); Queue<Lon..
分类:其他好文   时间:2015-01-14 18:08:01    阅读次数:163
649条   上一页 1 ... 46 47 48 49 50 ... 65 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!