给出一棵树的逻辑结构T=(N,R),其中:N={A,B,C,D,E,F,G,H,I,J,K}R={r}r={(A,B),(B,E),(B,F),(F,G),(F,H),(A,C),(C,I),(C,J),(J,K),(A,D)} 试回答下列问题:Given a logical structure of a tree, T=(N, R), and N={A, B, C, D, E, F, G, H, I, J,K}, R={r}, r={(A,B), (B,E), (B,F), (F,G), (F,H), (A,C), (C,I), (C,J), (J,K), (A,D)} Please answer these questions: (1)哪些是叶结点?which are the leaf nodes? (2)哪些是F的祖先?which is the parent node of Node F? (3)树的深度是多少?what is the depth of the tree?(注:根的层数为0,独根树深度为0,高度为1,其他题目同样如此;同一个小题的答案如果有多个字母,按照字典序排列,且不要以空格分隔,不同小题用一个空格隔开)
举一反三
- 【填空题】给出一棵树的逻辑结构T=(N,R),其中: N={A,B,C,D,E,F,G,H,I,J,K} R={r} r={(A,B),(B,E),(B,F),(F,G),(F,H),(A,C),(C,I),(C,J),(J,K),(A,D)} 试回答下列问题: (1)哪个是F的父结点?(2)哪些是B的子孙?(3)以结点C为根的子树的深度是多少? (注:根的层数为0,独根树深度为0,高度为1,其他题目同样如此)
- It should be noted that many people feel their life is both happy and meaningful. A: A B: B C: C D: D E: E F: F G: G H: H I: I J: J K: K L: L M: M N: N O: O P: P Q: Q R: R
- Most books on happiness today assert that happiness is beneficial to health. A: A B: B C: C D: D E: E F: F G: G H: H I: I J: J K: K L: L M: M N: N O: O P: P Q: Q R: R
- Evidence from research shows that it takes meaning for people to thrive. A: A B: B C: C D: D E: E F: F G: G H: H I: I J: J K: K L: L M: M N: N O: O P: P Q: Q R: R
- 设T=(N,R),其中N={A,B,C,D,E,F,G,H,I,J},R={(B, D), (B,E),(B,F),(C,G),(C,H),(E,I),(E,J),(A,B),(A,C)},T所表示的最准确的数据结构是( )。 A: 线性表 B: 树 C: 二叉树 D: 图