Tree Flashcards

1
Q

Complete Binary Tree :第 i 层最多有多少个节点?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Perfect Binary Tree : 高度为h的树会有多少个节点?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

如何定义 二叉树的节点?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Basic Terminologies in Binary Tree :

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Binary Tree : Properties

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Binary Tree types : Full Binary Tree

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Binary Tree types : Complete Binary Tree

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Binary Tree types : Perfect Binary Tree

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Binary Tree types : Degenerate Binary Tree

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Binary Tree types : Balanced Binary Tree

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Binary Search Tree : define Tree structure

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Binary Search Tree : newNode

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Binary Search Tree : Insert

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Binary Search Tree :find_minimum

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Binary Search Tree : find _maximum

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Binary Search Tree : height

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Tree : Time Complexity && Space Complexity

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

考试题:根据前序、中序遍历画出二叉树

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

考试题:根据后序、中序遍历画出二叉树

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

前序、中序、后序遍历:

21
Q

level_lraversal : how it works

Hint:
1.isempt
2.create queue & temp
3.enqueue(root)
4.while
{
temp = dequeue (queue)
…..
}
5.free

22
Q

level_Traversal : create 3 ADT

Hint: node,queue node, queue

23
Q

level_lraversal - create queue containing node : Isempty

24
Q

level_lraversal - create queue containing node : create queue

25
level_lraversal - create queue containing node : enqueue
1. temp 2. Null: front = temp 3. ! Null: rear & temp
26
level_Traversal - create queue containing node : dequeue
1. isempty 2.temp (delete) 3.data(return) 4.front (move) 5.free 6.return
27
后序遍历(Post order):层看法失效的情况,但是右侧法依然可以
原因:最后一层的上方有两个父母
28
Tree : Preorder Traversal
29
Tree : Inorder Traversal
30
Tree : Postorder Traversal
31
Binary Search Tree : Is_binarysearch_tree (With no biggest and smallest datas) Hint 1.exit condition 2.false condition 3.recursion
32
Binary Search Tree : Is_binarysearch_tree (With biggest and smallest datas) Hint: 1.exit condition 2.false condition 3.recursion
33
Binary Search Tree : Delete Hints: Part 1 : exit condition Part 2 : Recursion part 1.search (also plays a role in deleting nodes with 2 children) 2.delete nodes with no child or one child 3.delete nodes with 2 children: 1️⃣find the smallest node in the right sub tree 2️⃣delete (substitute the deleted node) 3️⃣link the rest subtree
34
Binary Search Tree : Find_inorder_successor Hint: Part 1: exit condition Part 2: recursion 1️⃣right child exist reach deepest 2️⃣ right child doesn't exist 1.root > data accessor ,root 2.root < data root 3.root = data return
35
二叉树的性质总结 :
补充 “ 树的性质 : 节点数 = 分支数 + 1 ”
36
例题 :树求叶子节点个数
hint : 完全二叉树度为0的节点数 = 度为2的节点数加1
37
例题 :求树的高度
38
例题 :满__叉树第n层的节点数
Hint :深度从1开始
39
例题 :哈夫曼树的性质
40
例题 :树的性质 -- 节点数 = 分支数 + 1
41
树 ------> 二叉树 的转换方法 :
42
二叉树 ------> 树 的转换方法 :
43
森林 ------> 二叉树 的转换方法 :
44
二叉树 ------> 森林 的转换方法 :
45
例题 :画线索二叉树 hint : 没有左孩子,连前驱;没有右孩子,连后继。两个都没有,就都要连
46
AVL Tree : right & left rotation
47
AVL Tree : LL & RR & LR & RL
48
Categories of Tree : how to distinguish them?
49
What does depth and height mean? ; What's the difference between them?
depth : The number of edges in the path **from root node** to the selected node. height : The number of edges in the **longest path connecting the selected node to any leaf node** .