CPP面试题笔试题_SAP.doc
上传人:sy****28 上传时间:2024-09-11 格式:DOC 页数:2 大小:14KB 金币:16 举报 版权申诉
预览加载中,请您耐心等待几秒...

CPP面试题笔试题_SAP.doc

CPP面试题笔试题_SAP.doc

预览

在线预览结束,喜欢就下载吧,查找使用更方便

16 金币

下载此文档

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

Part11两个人轮流拿10个硬币,每次可拿1,2,4个,拿到最后一个的为输,问有无必胜条件?答:后拿者赢2有1000个表,每个表有若干个item,每个item形式为(x,y),寻找这些表中overlapped的item3用一串节点存放N个数据,每个节点可放k个数据,其中包含额外的b个数据,问k为多少最能节省存储空间(假设N/(k-b)mod1=1/2)4一个链表排序程序,补足其中一些丢失的语句(排序中不用额外的存储空间)5一篇英文,将打乱的各段排序并写个总结,大意是吹嘘SAP如何的好6两个仓库的进货,出货和仓库间的货物转移交易的流水帐,写出每次交易的货物数,单价,交易后仓库中的货物数和amount(货物数*单价)Part21.JeffandDiamondlikeplayinggameofcoins,Onedaytheydesignedanewsetofrules:1)Totally10coins2)Onecantakeaway1,2or4coinsatonetimebyturns3)Whotakesthelastloses.GiventheserulesWhetherthewinningstatusispre-determinedornot解答:1:从后面开始考虑,最后肯定要留1个才能保证自己赢2:所以要设法让对方留下2,3,5个3:也就是要自己取后留下1,4,6,7,8,9。。。4:如果自己取后留下6,对方取2个,与(3)矛盾,所以排除65:如果自己取后留下8,对方取4个,与(3)一样情况,所以也排除86:同样,9也不行,如果我抽后剩下9,对方抽2个,就反过来成对方抽剩成7个了,也与(3)矛盾,所以也排除7:所以很显然,我只能抽剩1,4,78:因为只能抽后剩1,4,7才能赢,我先抽得话不可能达到这几个数,很显然,只能让对方先抽,也即是先抽的人输2.theUIspecialistDafnafoundaproblemthatsomeoftheItemsonthemarketingdocumentformoverlappedwitheachother.becausethisformwasimplementedbydifferntdevelopersandtheydidn'tcaretheparticularappearanceofoneitem.ProductmanagerTidavdecidedtowriteonesmallcheckingtooltogeneratetheoverlappeditemsonallforms.Hecalledinhisguystodiscussaboutit.Supposetheinputistheintegercoordinates(x,y)odtheitems(allrectangles)ononeform.Constructanefficientmethedtofindouttheoverlappeditems.Hint:Themostdirectwaytodosoiscomparingeachitemswiththeothers,Given1000forms.eachwith100-1000itemsonaverage.theO(n2)algorithmiscostly.SomegurusuggestedthatoneO(n)methodcouldhelponlyif6.5kilobytesextrastorageisavailable.Oneelitearguedthathecouldcutdownthenumberto1%,It'snowyourturntodescribetheidea.writeoutthepseudocodes,vertifyhisalgorithmandproposemoreadvancedoptimizationifpossible.3inafilesystem,dataneednotbesequentiallylocatedinphysicalblocks,Weuseanumberoftablesstoringnodesimformation.Supposenowweuseafixednodesizeofvariable-lenthn,ittakes[n/(k-b)]nodestostorethisitem.(Herebisaconstant,signifyingthatbwordsofeachnodecontaincontrolinformation,suchasalinktothenextnode).Iftheavara