2013 微软校园实习生笔试题及详解(16-20题)

本文精选了算法与数据结构领域的典型问题进行解析,包括二叉树的遍历组合、字符串子串数量计算、SQL更新语句影响范围、最短路径算法应用及通过称重查找次品球的方法。每道题目均提供了选项与详细解析。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

16. we can recover the binary tree if given the output of(5 Points)

    A. Preorder traversal and inorder traversal

    B. Preorder traversal and postorder traversal

    C. Inorder traversal and postorder traversal

    D. Postorder traversal

 

 

 

 

 

 

问题解析:

 

17. Given a string with n characters, suppose all the characters are different from each other, how many different substrings do we have?(5 Points)

    A. n+1

    B. n^2

    C. n(n+1)/2

    D. 2^n-1

    E. n!

 

 

 

 

 

 

 

问题解析:

 

18. Given the following database table, how many rows will the following SQL statement update?(5 Points)

 

BookId              

Title

Category

NumberofCopies

AuthorId

1

SQL Server 2008

MS

3

1

2

SharePoint 2007

MS

2

2

3

SharePoint 2010

MS

4

2

5

DB2

IBM

10

3

7

SQL Server 2012

MS

6

1

 

 

 

 

 

 

 

 

                

    A. 1

    B. 2

    C. 3

    D. 4

    E. 5

 

 

 

 

 

 

 

问题解析:

 

19. What is the shortest path between node S and node T, given the graph below? Note: the numbers represent the lengths of the connected nodes.(13 Points)

 

 

  A. 17

    B. 18

    C. 19

    D. 20

    E. 21

 

 

 

 

 

 

问题解析:

 

20. Given a set of N balls and one of which is defective (weighs less than others), you are allowed to weigh with a balance 3 times to find the defective. Which of the following are possible N?(13 Points)

    A. 12

    B. 16

    C. 20

    D. 24

    E. 28

 

 

 

 

 

 

 

问题解析:

 

转载于:https://www.cnblogs.com/Allie0920/archive/2013/04/07/3006170.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值