微软实习生笔试题目_第1页
微软实习生笔试题目_第2页
微软实习生笔试题目_第3页
微软实习生笔试题目_第4页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

微软实习生笔试题目

1.Selectionsort80items,after32iterations,howmanypositionsofitemsaredetermined?

Choose:32。

2.Whichisusedinsyncprocess//threadinoperationsystem?

A.MutexB.mailboxC.SemaphoreD.localprocedurecall

Choose:AC

3.Sizeofastackis5,inputisasequence1,2,,7,whichispossibleoutput?

A.1234567B.7654321C.5643721D.1765432E.3217564

Choose:AC

4.010111001*011001+1101110=?

A.0001010000111111B.0101011101110011C.0011010000110101

Choose:A

5.Whatistheoutputofthefollowcode?

voidmain(intargc,char*argv[]){

inti=11;

intconst*p=i;

p++;

cout*p

A.11B.12C.GarbagevalueD.ComiplererrorE.Noneofabove

Choose:C

6.Whichcodeiscorrect?

C.vectorf(){

vectorv(3);

returnv;

}

E.Noneofabove

Choose:C

7.Whichnumberhasdifference78633after180-degreerotation?

A.60918B.91086C.18609D.10968E.86901

Choose:D

8Whichstatementistrue?

A.InorderandpreordercandetermineaBinarytree

B.PostorderandpreordercandetermineaBinarytree

C.Foralmostsortedarray,InsertionsortismoreefficientthanQuicksort

D.IfT(n)=2T(n/2)+(n),ThenT(n)=(nLogn)

E.noneofabove

Choose:ACD

9.Whichstatementistrue?

A.Insertionandbublesortarenoteffientforlargedatasets

B.ThecomplexityofQuickSortisO(n2)inworstcase

C.Itisneeded6swapoperationstosortsequence7,6,5,4,3,2,1(ascending)bySelectionsort

D.Heapsorthastwooperations:Insertionandrootdeletion

E.Noneofabove

Nochoose

12.Theoutputofthefollowingcodeis020120,whatarethetypeofaandb?

classTest{

____inta;

____intb;

Test(int_a,int_b){a=_a;b=_b;}

}

voidmain(){

Testt1(0,0),t2(1,1);

t1.b=10;

t2.b=20;

cout

}

A.static/constB.const/staticC.__/staticD.conststatic/staticE.Noneof

above

Choose:C

13.A3-orderB-treehas2047keywords,whatisthemaximumheight?

A.11B.12C.13D.14

nochoose

14.Whichcanbeusedbothtovariableandfunction?

A.staticB.virtualC.externD.inlineE.const

Choose:ACE

15.Whatistheoutputofthefollowcode?

char*f(char*str,charch){

char*it1=str;

char*it2=str;

while(*it2!=\0){

while(*it2==ch)

{

it2++;

}

*it1++=*it2++;

}

returnstr;

}

intmain(intargc,char*argv[]){

char*a=newchar[10];

strcpy(a,abcdcccd);

cout

return0;

}

A.abdcccdB.abddC.abccD.abddcccdE.Accessviolation

Choose:D

16.Whatisthecomplexityoftheresultcallofpower(b,e)inthefollowcode?

intpower(intb,inte){

if(e==0)return1;

if(e%2==0)returnpower(b*b,e/2);

returnb*power(b*b,e/2);

}

A.logarithmicB.linearC.quadraticD.exponentical

Choose:A

17.Take2cardsfromonefullpoker(52cards,26redand26black)andhalfpokereach,whatistheprobabilityoftheeventthattwocardsarebothred?

A.1/2,1/2B.25/102,12/50C.50/51,24/25D.25/51,12/25E.25/51,1/2

Choose:B

18.Howmanykindsofoutputofstackwiththeinput1,2,,n?

B.C_2n^n-C_2n^(n+1)C.((2n)!)/(n+1)n!n!D.n!E.none

Choose:C

19.WhatistheminimumtimeandspacecomplexitytocomputetheLargestIncreasedSubsequence(LIS)ofarray?

A.N^2,N^2B.N^2,NC.NlogN,ND.N,NE.N,C

Choose:C

20.Whatistheoutputofthefollowcode?

structItem{

charc;

Item*next;

};

Item*f1(Item*x){

Item*prev=NULL;

Item*curr=x;

while(curr){Item*next=curr-next;

curr-next=prev;

prev=curr;

curr=next;

}

returnprev;

}

voidf2(Item*x){

while(x

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论