求大家给我的老DELL Inspiron 530推荐一块新显卡# Hardware - 计算机硬件
h*g
1 楼
一家CS公司以前的面试题,看了半天硬是没看懂,能不能帮忙看看这代码输出啥?
谢谢!
1 // *********
2 // SAMPLE #2
3 // *********
4
5 class NoName
6 {
7 children = new Hashtable()
8 name = ""
9
10 boolean haschild(child: string)
11 {
12 return children.contains(child)
13 }
14
15 NoName addChild(child: string)
16 {
17 childnode = new NoName()
18 childnode.name = child
19 children[child] = childnode
20 return childnode
21 }
22
23 NoName getNode(child: string)
24 {
25 if haschild(child)) then return children[child]
2
谢谢!
1 // *********
2 // SAMPLE #2
3 // *********
4
5 class NoName
6 {
7 children = new Hashtable()
8 name = ""
9
10 boolean haschild(child: string)
11 {
12 return children.contains(child)
13 }
14
15 NoName addChild(child: string)
16 {
17 childnode = new NoName()
18 childnode.name = child
19 children[child] = childnode
20 return childnode
21 }
22
23 NoName getNode(child: string)
24 {
25 if haschild(child)) then return children[child]
2