面试题
来源:互联网 发布:linux vi如何到指定行 编辑:程序博客网 时间:2024/06/07 05:25
今天去面试,给了我一套面试题,有4道题,回答其中一道就可以,我一看当场就懵bi了,题目是这样的:
一、Mala-Offline is a company which has CEO Bill and a heerarchy of employees.Employees can have a list of toher employees reporting to them,which can themselves have reports,and so on.An employee with at least one report is called a manager.
Please implement the closesCommonManager method to find this closest manager(i.e.farthest from the CEO) to two employees. You may assume that all employees eventually report up to the CEO.
Simple data:
CEO Bill has 3 employees reporting to him:{DOM,SAMIR,MICHAEL}
DOM has three reports{PETER,SOS,PORTER}
SAMIR has no reports{}
MICMAEL has no reports{}
PETER has 2 reports{MILTON,NINA}
SOS has no reports{}
PORTER has no reports{}
Simple calls:
closestCommonManager(MILTOM,NINA) = PETER
closestCommonManager(NINA,PORTER) = DOM
closestCommonManager(NINA,SAMIR) = BILL
closestCommonManager(PETER,NINA) = PETER
使用C++或java语言实现(任选一种):
先上传第一道题目,其他的以后再说,表示手打英文真的好累!
答案正在研究,以后会解答,另外,有哪位大神有思路可以下方留言哦~~
- 面试题....
- 面试题
- 面试题
- 面试题
- 面试题
- 面试题
- 面试题
- 面试题
- 面试题
- 面试题
- 面试题
- 面试题
- 面试题
- 面试题
- 面试题
- 面试题
- 面试题
- 面试题
- stm32
- ftp连接池实现
- 当IE浏览器不支持document.getElementByClassName()
- Java RMI详解
- div使用jQuery autocomplete
- 面试题
- Java动态代理的两种实现方法
- css3新属性 附上盒子居中例子
- navicat 10.0.50注册码
- ng-class
- 最小代价问题
- String,StringBuffer,StringBuilder三者的区别
- 现代3D图形编程学习-关于本书
- AndroidStudio不自动添加新创建的文件到VCS