码迷,mamicode.com
首页 >  
搜索关键字:interview    ( 649个结果
CC150 9.6
9.6Givenamatrixinwhicheachrowandeachcolumnissorted,writeamethodtofindanelementinit.voidsearch(int[][]a,intt) { intm=a.length; intn=a[0].length; //Startfromright-uppoint. //ifrightUp==t,found //ifrightUp>t,allcolumnare>t //ifrightUp<t,allroware<..
分类:其他好文   时间:2014-12-14 18:46:19    阅读次数:149
CC150 9.3
9.3Givenasortedarrayofnintegersthathasbeenrotatedanunknownnumberoftimes,giveanO(logn)algorithmthatfindsanelementinthearray.Youmayassumethatthearraywasoriginallysortedinincreasingorder.EXAMPLE:Input:find5inarray(1516192025134571014)Output:8(theindexof5inthea..
分类:其他好文   时间:2014-12-14 18:45:30    阅读次数:130
CC150 8.7
8.7Givenaninfinitenumberofquarters(25cents),dimes(10cents),nickels(5cents)andpennies(1cent),writecodetocalculatethenumberofwaysofrepresentingncents.intways(intsum,intn,intcent)//centismaxCentallowtouse. { if(sum==n) return1;//thiswayisgood. if(sum>n) re..
分类:其他好文   时间:2014-12-14 18:44:41    阅读次数:152
CC150 20.11
20.11Imagineyouhaveasquarematrix,whereeachcellisfilledwitheitherblackorwhite.Designanalgorithmtofindthemaximumsubsquaresuchthatallfourbordersarefilledwithblackpixels.//Abruteforcesolution. //n*n //iteratefromnto1. //Forn,findallpossiblesubsquare EnumColor..
分类:其他好文   时间:2014-12-14 18:43:36    阅读次数:225
CC150 20.8
20.8GivenastringsandanarrayofsmallerstringsT,designamethodtosearchsforeachsmallstringinT.KMPBMFancymethod.
分类:其他好文   时间:2014-12-12 16:54:50    阅读次数:123
CC150 20.9
20.9Numbersarerandomlygeneratedandpassedtoamethod.Writeaprogramtofindandmaintainthemedianvalueasnewvaluesaregenerated.classMedianNum { //O(n) voidinsert(intn) { if(size==0) { head=newNode(n); media=head; } elseif(n<head.num) { NodenewHead=newNode(n); ne..
分类:其他好文   时间:2014-12-12 16:49:31    阅读次数:151
Company interview process
1. Epic OA 12/7 submitted, Prob get result by 12/22.2. Yelp 1st phone interview. 15 mins recuriter quick programming, Databasequestions.3. FactSet 1.....
分类:其他好文   时间:2014-12-12 11:32:18    阅读次数:142
CC150 19.11
19.11Designanalgorithmtofindallpairsofintegerswithinanarraywhichsumtoaspecifiedvalue. //Assumeaisnotnull. // //aisnotsorted. // //Option1isusingaset. List<Pair<Integer,Integer>>sumUpTo(int[]a,intsum) { //Option1 Map<Integer>set=newHashSet&..
分类:其他好文   时间:2014-12-11 10:36:22    阅读次数:168
CC150 20.1
20.1Writeafunctionthataddstwonumbers.Youshouldnotuse+oranyarithmeticoperators.//SorryIdon‘tknow.Ihatequestionslikethis.
分类:其他好文   时间:2014-12-11 10:35:54    阅读次数:133
CC150 20.2
20.2Writeamethodtoshuffleadeckofcards.Itmustbeaperfectshuffle-inotherwords,each52!permutationsofthedeckhastobeequallylikely.Assumethatyouaregivenarandomnumbergeneratorwhichisperfect.//Randomlygenerateaintkfrom1(inclusive)ton(inclusive). intrandom(intn); cl..
分类:其他好文   时间:2014-12-11 10:35:50    阅读次数:165
649条   上一页 1 ... 48 49 50 51 52 ... 65 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!