12320171.......................................................21..................................................................................................72.......................................................92................................................................................................143.....................................................163................................................................................................2122312201.()A.B.C.D.2.().A.B.C.D.3.()A.B.C.D.4.A[m][n]A[0][0]644(10)A[2][2]676(10)A[3][3](10)(10)10A688B678C692D6965.()A.B.C.D.6.k().A2k-1B.2K+1C.2K-1D.2k-17.18A[19]A[1]A3()A.123B.9523C.953D.94238.nA.O1B.OnC.O1og2nD.On29.734552564462010323HK=K%91A1B2C3D410.6()A.5B.6C.7D.81261._________________________2.(n3+n2log2n+14n)/n2_____3.ACDEFGHIJ_______________4.923+-102/-______3+4X-2Y/3_______________________________5.n________________________________6.ne_____n_________7.AOV___________8.n________n________9.(12,23,74,55,63,40)Key%4________________________________________________________________________________________________10.B_____11.______42312._____6241.AA[0].nextA01234567data605078903440next35720412.103.VE(1,2)3,(4,6)4,(1,3)5,(1,4)8,(2,5)10,(4,7)20V={1,2,3,4,5,6,7};E={(1,2)3,(1,3)5,(1,4)8,(2,5)10,(2,3)6,(3,4)15,(3,5)12,(3,6)9,(4,6)4,(4,7)20,(5,6)18,(6,7)25};4.4,2,5,8,37141.LinkListmynote(LinkListL){//Lif(L&&L-next){q=LL=Lnextp=LS1while(pnext)p=pnextS2pnext=qqnext=NULL}returnL10523}1.123a2,a3,,,an,a11S12S23a1,a2,,,an,2.voidABC(BTNode*BT){ifBT{ABC(BT-left);ABC(BT-right);coutBT-data'';}}2.8:boolFind(BTreeNode*BST,ElemType&item){if(BST==NULL)returnfalse;//else{if(item==BST-data){item=BST-data;//return___________;}elseif(itemBST-data)returnFind(______________,item);elsereturnFind(_______________,item);623}//if}8HLXintCountX(LNode*HL,ElemTypex)72312201.A2.D3.D4.C5.C6.D7.D8.C9.D10.A1261.2.O(n)3.9334.-134X*+2Y*3/-5.2nn-1n+16.e2e7.8.n(n-1)/2n(n-1)9.12407423,556310.111.O(log2n)O(nlog2n)12.6241.7850406034902.011101010111011101010111011113.(1,2)3,(4,6)4,(1,3)5,(1,4)8,(2,5)10,(4,7)204.128235.4.4,2,5,8,36.127143.123a2,a3,,,an,a14.28trueBST-leftBST-right8intCountX(LNode*HL,ElemTypex){inti=0;LNode*p=HL;//iwhile(p!=NULL){if(P-data==x)i++;p=p-next;}//while,ixreturni;}//CountX44444222555228843528349232281nxx()AnBn/2C(n+1)/2D(n-1)/22,qp,qps,()Aslink=plink;plink=s;Bplink=s;slink=q;Cplink=slink;slink=p;Dqlink=s;slink=p;3ABCD4118625A24B71C48D531321_____________________________________2___________________________3aa[o].next_________________________________________________a012345678datanext4HL________________60564238742543762011023__________________5n_____________________6_______________75_________________5__________________8_________________________________________________9____________________10ABCDEFGHIJ__________________,________,H________,_______________11_________,________________12mB______________6241467956384080,95242B=122345572003783115361123HT[0..12]Hkey=key%133ABECKFGHIJEBCDAFHIGJ4VGV={0123456789}E={01041217283438565859677889}V081617863453091341#includeiostream.h#includestdlib.hconsstintstackmaxsize=30;typedefintelemtype;structstack{elemtypestack[stackmaxsize];inttop;1223};#includestack.hVoidmain(){stacka;initstack(a);intx;cinx;while(x!=-1){push(a,x);cinx;}while(!stackempty(a))coutpop(a);coutend1;}__________________________________________________________.2TemplatecalsstypevoidBinTreeTypeunknown(BinTreeNodeType*t){BinTreeNodeType*p=t,*temp;if(p!=NULL){temp=pleftchild;pleftchild=prightchild;prightchild=temp;unknown(pleftchild);undnown(prightchild);}}________________________________132310intBinsch(ElemTypeA[],intlow,inthigh,KeyTypeK){if(low=high){intmid=1if(K==A[mid].key)returnmid;elseif(KA[mid].key)return2elsereturn3}elsereturn410Lnodea1n-1an,anan-11Voidcontrary(Lnode*&HL)14232281234CDAB1321233856256042744HLnext=NULLHL=HLnext5n-16S.stack[S.top];HSdata;753189101033BIJ11Olog2nO(nlog2n);12mm-16241[382440]46[56809579]24[3840]46[56809579]24384046[56809579]2438404656[809579]243840465679[8095]2438404656798095278150357452031233612ASLSUCC=14/10=1.43EDCBIHJGFA01234567891011121523481611349130456378221011low+high/2;2Binsch(A,low,mid1,K);3Binsch(A,mid+1,high,K);4-110{Lnode*P=HL;HL=NULL;While(p!=null){Lnode*q=p;P=pnext;qnext=HL;HL=q;}}0128345679014273865904389567120413728695162331(A)(B).(C).(D).2SC,for(i=n-1i=0i--)for(j=0jij++)S(A)n2(B).O(nlgn)(C).O(n)(D).O(n2)3ABCD4ABCD5kAk-1BkCk-1kD1k660121A11B13C48D377Depth-FirstSearch(DFS)ABCD8QaQAp=Q.front-next;p-next=Q.front-next;Bp=Q.front-next;Q.front-next=p-next;Cp=Q.rear-next;p-next=Q.rear-next;Dp=Q-next;Q-next=p-next;9HuffmanWPLABCD10AlchildBdataCrchildDrootbcdafront1723123a1,a2,,anLaiLOC(ai)4(nextprior)qppxy5nn67BCACBA1H(k)=k%13,{22,12,24,6,45,7,8,13,21},(6)(1)HASH(2)219,14,22,15,20,21,56,10.812(1)xyeBACDFEG18233(2)3ABABijVijV13-525224633725241342-152-9529558A-B5418,12,25,53,18,n(5)5A(8)ABCDEF1A2ADFSBFS6ABCDEF0.150.150.10.10.20.3(7)1Huffman2WPL3ABCDEFHuffman76426634675127