20171402801int func(int n){int i=0, sum=0;while(sum < n) sum += ++i;return i;}A O(logn)B O(n1/2)C O(n)D O(nlogn)2A IB IC I D3A BC D4A BC1D25e,a,c,b,d,g,f aA cB dC fD g6{a,b,c,d,e,f,g,h}010010, 0000, 0101001, 011110001 0100011001001011110101A a c g a b f hB a d b a g b bC a f b e a g dD a f e e f g d7G1643343 GA10B11C13D1589B+A BC D10A B C D11A B C D12M1M2I SA) 1.5GHz 1.2 GHz M1M2 P CPI21P M1M2A0.4B0.625C 1.6D 2.513464M8DRAM3232double x804 001AH xA1B2C3D414Cfor(i=0;i<=9;i++){temp = 1;for(j=0;j<=i;j++) temp *= a[j];sum += temp}aABCD15A B C D1629107 6A24B26C28D3217A B C D18MM CSA MM CPU CS CPUB MM CSC MM CSD MM RAM ROM CS ROM19AB ALU)CD20A CPUBCD PC I-Express l621I/OA I/O I/OB I/OC I/O I/OD I/O22AB CPUCD CPU23t=2A J2J3B J1J4C J2J4D J1J324(trap)A->->->B->->->C->->>D->->->2560 K140 KBA320 K380 KB B3500 K80 KBC420 K180 KB D4500 K80 KB26 1 KB512 B 1 026BA1026 B B1536 B C1538 B D2048 B27ABCD28CPUI/OA BC D29A BC D3045A.5B.9C.12D.2031f1f2f1f2fd1fd2f1f2f1f2fd1fd2A B C D32DMADMAA->->->B->->->C->->->D->->->33OSI400 B PDU20 BA80% B83% C87% D91%3430dBA4B8C16D3235,H Internet IP IEEE 802.11F,F1 23A00-12-34-56-78-9a00-12-34-56-78-9b00-12-34-56-78-9cB00-12-34-56-78-9b00-12-34-56-78-9a00-12-34-56-78-9cC00-12-34-56-78-9b00-12-34-56-78-9c00-12-34-56-78-9aD00-12-34-56-78-9a00-12-34-56-78-9c00-12-34-56-78-9b36IP IP IP IPA0.0.0.0B127.0.0.1C200.10.10.3D255.255.255.25537RIP OSPF BGPA TCP UDP IPB TCP IP UDPC UDP TCP IPD UDP IP TCP3821.3.0.0/16128IPA254B256C510D51239TCP MSS=1 KB RTT = 5 ms,64 KB,32 KBA25 ms B30 ms C160 ms D165 ms40FTPABC TCP 20D TCP 2141477041.(15(a+b)*(c*(-d))(a*b)+(-(c-d)):typedef struct node{char data[10]; //struct node *left, *right;}BTree;(1)(2)C C++42.(8Prim((MST)(1)G A G MST(2)G MST(3)MST43.(13f(n)C f1int f1(unsigned n){int sum=1, power=1;for(unsigned i=0;i<=n-1;i++){power *= 2;sum += power;}return sum;}f1int float f(n)f2unsigned int32float IEEE 754(1)n=0f1f1i n int f1(2)f1(23)f2(23)(3)f1(24)f2(24)33 554 43133 554 432.0(4)f(31)=232-1f1(31)-1,f1(n)f(n)n(5)f2(127)7F80 0000H f2(n n f2(n)n44.(10M43f1((1)M RISC CISC(2)f1(3)20cmp i n-1i n-1f1(0)i=0cmp/CF(4)23shl power *2f2shl power *245.(743f144(1)f1(2)1push ebp)(3)M I/O P f1scanf()n scanf()P CPU46.(83thread1thread2thread3P V(wait()signal())47.(9N GBN)1000 B S x,y R x,y x y3100Mbps RTT=0.96mst00t1(1)(a)t0t1Sx,y(2)(a)t1Sx,y(3)(b)t1Sx,y(4)20171B2C3A4B5B6D7B8A9B10B11D12C13C14A15D16A17C18B19A20D21D22B23D24C25B26D27B28D29B30D31B32B33A34D35B36A37D38C39A40C41(1)32(2)10void BtreeToE(BTree *root){BtreeToExp(root, 1); //1}void BtreeToExp( BTree *root, int deep){if(root == NULL) return; //else if(root->left==NULL&&root->right==NULL) //->data); //else{//1BtreeToExp(root->left, deep+1);->data); //BtreeToExp(root->right, deep+1);//1}}1)2)C C++42(1)PrimS S SS A(A,D)(A,B)(A,E)(A,D)SS A D(A,B)(A,E)(D,E)(C,D)(D,E)SS A D E(A,B)(C,D)(C,E)(C,E)SS A D E C(A,B)(B,C)(B,C)SS(A D),(D E),(C E),(B C) 4,1(2)G MST2MST(3)MST23143(1)i n unsigned-n=0n-11232-1,unsigned-2i n int1-n=0n-1-1i=0<=n-for1(2)f1(23)f2(23)1f(23)=223+1-1=224-1241int32float18232324f1(23) 00FF FFFFH1f2(23) 4B7F FFFFH12410000 0000 1111 1111 1111 1111 1111 11112023+127(10)=1001 01102111 1111 1111 1111 1111 11112(3)n=24f(24)=1 1111 1111 1111 1111 1111 1111 B,float24f2(24)f1(24) 11f2(24)(4)f(31)int f1(31)321int-1,f1(31)-11int0311f1(n)f(n)n301n=30(5)IEEE 7541f2float7F80 0000H+(1n=126f(126)=2127-1=1.112126127+126=2531254, IEEE 754f2n1261n=23f(23)241,float24f2n23(1n=23,n=12644(1)M CISC1M RISC1(2)f196B1f1p0040 1020H0040 107FH f10040 107FH - 0040 1020H + 1 = 60H = 961(3)CF=11cmp i n-1f1(0)n=0i=0i=0000 0000H n-1=FFFF FFFFH20/0000 0000H + 0000 0000H+1 = 0000 0001H C = 0CF = C 1 = 12(4)f2shl power*21shl f2power floatf2shl power*2(245(1)f120f111(2)push ebp1000 0000 00011000 0000 00011111(3)scanf()P1P1P1CPU1 46semaphore mutex_y1=1; //mutex_y1thread1thread3ysemaphore mutex_y2=1; //mutex_y2thread2thread3ysemaphore mutex_z=1; //mutex_z z5)247(1)t0t1 3 1 S0,0S1,0S2,01R3,3330-2(2)t151S5,2(1S1,2 138GBN>=+17 S3,0S4,15(3)31S2,3(1GBN NS2,0S2R23(4)U = / = N * Td /(Td + RTT + Ta)U N Td RTT TaTd=Ta。