数据结构与算法JAVA语言描述第四章部分课后习题参考答案

4.1:

      

  1. A
  2. G、H、I、L、M and K

4.2:

       For node B:

  1. A
  2. D and E
  3. C
  4. 1
  5. 3

For node C:

  1. A
  2. F
  3. B
  4. 1
  5. 2

For node D:

  1. B
  2. G and H
  3. E
  4. 2
  5. 1

For node E

  1. B
  2. I and J
  3. D
  4. 2
  5. 2

For node F

  1. C
  2. K
  3. Null
  4. 2
  5. 1

For node G

  1. D
  2. Null
  3. H
  4. 3
  5. 0

For node H

  1. D
  2. Null
  3. G
  4. 3
  5. 0

For node I

  1. E
  2. Null
  3. J
  4. 3
  5. 0

For node J

  1. E
  2. L and M
  3. I
  4. 3
  5. 1

For node K

  1. F
  2. Null
  3. Null
  4. 3
  5. 0

For node L

  1. J
  2. Null
  3. M
  4. 4
  5. 0

For node M

  1. J
  2. Null
  3. L
  4. 4
  5. 0


 

4.3:

       The depth of the tree is 4

4.4:

       Each node has two links. Except for the root node, each other node is connected to its parent node through a link, so there are N-1 links, because 2N - (N-1) = N + 1 . So it shows that in a binary tree of N nodes, there are N+1 null links representing children.

4.8:

       Prefix: - * * ab + c d e

       Infix:  ( a * b ) * ( c + d ) – e

       Postfix: a b * c d + * e –

4.9:

       a:

b:

4.19:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值