码迷,mamicode.com
首页 >  
搜索关键字:interview    ( 649个结果
CC150 4.2
4.2Givenadirectedgraph,designanalgorithmtofindoutwhetherthereisaroutebetweentwonodes.Node { List<Node>neighbours; } booleanisConnected(Nodefrom,Nodeto) { Stack<Node>toVisit=initStack(); Set<Node>seen=initSet(); toVisit.push(from); while..
分类:其他好文   时间:2014-11-27 08:05:32    阅读次数:147
CC150 4.3
4.3Givenasorted(increasingorder)array,writeanalgorithmtocreateabinarytreewithminimalheight.[1,2,4,5,6]CreateaBTwithminheight.=>balancedtree.Nodebuild(intarray) { returnbuild(array,0,array.length-1,null); } O(logn) privateNodebuild(int[]array,intfrom,int..
分类:其他好文   时间:2014-11-27 08:04:10    阅读次数:189
CC150 4.1
4.1Implementafunctiontocheckifatreeisbalanced.Forthepurposesofthisquestion,abalancedtreeisdefinedtobeatreesuchthatnotwoleafnodesdifferindistancefromtherootbymorethanone.Abalancedtree?http://en.wikipedia.org/wiki/Self-balancing_binary_search_treeIteratethetr..
分类:其他好文   时间:2014-11-27 08:03:52    阅读次数:190
CC150 4.4
4.4Givenabinarysearchtree,designanalgorithmwhichcreatesalinkedlistofallthenodesateachdepth(i.e.,ifyouhaveatreewithdepthD,you’llhaveDlinkedlists).List<List<Node>>build(Noderoot) { List<List<Node>>toReturn=initList(); build(root,0,toR..
分类:其他好文   时间:2014-11-27 08:02:53    阅读次数:189
CC150 4.6
4.6Designanalgorithmandwritecodetofindthefirstcommonancestoroftwonodesinabinarytree.Avoidstoringadditionalnodesinadatastructure.NOTE:Thisisnotnecessarilyabinarysearchtree.BTNodefind(Noden,Nodea,Nodeb) { if(n==a||n==b) { returnn; } intnodeMatch=nodeMatch(a...
分类:其他好文   时间:2014-11-27 08:02:42    阅读次数:180
CC150 4.5
4.5Writeanalgorithmtofindthe‘next’node(i.e.,in-ordersuccessor)ofagivennodeinabinarysearchtreewhereeachnodehasalinktoitsparent.//BST. classNode { Nodeparent; Nodeleft; Noderight; } Nodemin(Nodenode) { if(node==null) returnnull; while(node.left!=null) nod..
分类:其他好文   时间:2014-11-27 08:01:56    阅读次数:218
Oracle 面试宝典 - 3
Oracle Interview Questions
分类:数据库   时间:2014-11-25 14:19:56    阅读次数:261
Oracle 面试宝典 - 1
Oracle Interview Questions
分类:数据库   时间:2014-11-25 14:18:51    阅读次数:306
Oracle 面试宝典 - 5
Oracle Interview Questions
分类:数据库   时间:2014-11-25 14:18:50    阅读次数:393
Oracle 面试宝典 - General Questions
Oracle interview - General Questions
分类:数据库   时间:2014-11-25 14:14:58    阅读次数:191
649条   上一页 1 ... 51 52 53 54 55 ... 65 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!