Deck 19: Binary Trees

ملء الشاشة (f)
exit full mode
سؤال
In the diagram of a binary tree, an arrow is called a(n) ____.

A) relation
B) path
C) directed line
D) directed branch
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Every node in a binary tree has at most ____ children.

A) one
B) two
C) three
D) four
سؤال
A node in a binary tree is called a(n) ____ if it has no left and right children.

A) edge
B) branch
C) leaf
D) path
سؤال
The level of the root node of a binary tree is 1.
سؤال
In a binary tree, the branches go only from a child to a parent.
سؤال
To delete an item from the binary search tree, you must do the following:1.Find the node containing the item (if any) to be deleted.
2.Delete the node.
سؤال
Duplicates are allowed in a binary search tree.
سؤال
Every node in a binary tree has ____ pointers.

A) one
B) two
C) three
D) four
سؤال
For classes with pointer data members, you must explicitly overload the assignment operator and include the destructor.
سؤال
All binary tree traversals start at the left-most child node.
سؤال
Three lines at the end of an arrow in the diagram of a binary tree indicate that the subtree ____.

A) has three branches
B) has three children
C) is full
D) is empty
سؤال
The operations to do inorder, preorder, and postorder traversals of a binary search tree are the same as those for a binary tree.
سؤال
Consider that A is a binary tree, C and D are the subtrees of A.Which of the following statements is always true?

A) C and D are binary trees.
B) C and D are search binary trees.
C) C and D are empty trees.
D) A is empty.
سؤال
A pointer to the root node of the binary tree is stored outside the binary tree in a pointer variable, usually called the ____.

A) node
B) parent
C) root
D) nodeType
سؤال
The item search, insertion, and deletion operations all require the binary tree to be traversed.
سؤال
In C++, a function name without any parentheses is considered a pointer to the function.
سؤال
In a diagram of a binary tree, each node is represented as a(n) ____.

A) line
B) triangle
C) circle
D) rectangle
سؤال
A binary tree has a special node called the ____ node.

A) super
B) root
C) superparent
D) rootleaf
سؤال
After deleting the desired item from a binary search tree, the resulting tree must be a binary search tree.
سؤال
Each link in a binary tree node points to a(n) ____ of that node.

A) parent
B) child
C) value
D) sibling
سؤال
A binary tree is empty if root is ____.

A) '0'
B) 1
C) "zero"
D) nullptr
سؤال
The sequence of operations in a postorder traversal is ____.

A) traverse left; traverse right
B) traverse left; traverse right; visit
C) visit; traverse left; traverse right
D) traverse left; visit; traverse right
سؤال
Assume the key of the left child below the root node of a binary search tree is 30.The value in the root node could be ____.

A) 0
B) 10
C) 30
D) 40
سؤال
In a(n) ____________________ traversal, the binary tree is traversed as follows:1.Traverse the left subtree
2.Visit the node
3.Traverse the right subtree
سؤال
The three traversal algorithms discussed for binary trees are ____, ____, and ____.

A) order, preorder, postorder
B) in, preorder, order
C) order, preorder, post
D) inorder, preorder, postorder
سؤال
In a binary search tree, the data in each node is ____ the data in the left child.

A) larger than
B) smaller than
C) equal to
D) larger or equal to
سؤال
In a(n) ____________________ traversal, the binary tree is traversed as follows:1.Visit the node.
2.Traverse the left subtree.
3.Traverse the right subtree.
سؤال
The listing of the nodes produced by the postorder traversal of a binary tree is called the ____.

A) postsequence
B) postorder sequence
C) postorder table
D) post-script
سؤال
A binary tree is also a(n) ____.

A) stack
B) linked list
C) graph
D) array
سؤال
The listing of the nodes produced by the preorder traversal of a binary tree is called the ____________________.
سؤال
In addition to the inorder, preorder, and postorder traversals, a binary tree can also be traversed level-by-level, which is also known as ____________________ traversal.
سؤال
The key of the right child below the root node of a search binary tree is 40.The value in the root node could be ____.

A) 30
B) 40
C) 50
D) 60
سؤال
The ____________________ of a binary tree is the number of nodes on the longest path from the root to a leaf.
سؤال
The search function searches the binary search tree for a given item.If the item is found in the binary search tree, it returns ____.
C) a reference to the node where the item was found
D) 1
سؤال
The ____ of a node in a binary tree is the number of branches on the path from the root to the node.

A) height
B) level
C) width
D) size
سؤال
In a binary tree, the level of the children of the root node is ____.

A) 0
B) 1
C) 2
D) 3
سؤال
The ____________________ of a path in a binary tree is the number of branches on that path.
سؤال
When traversing a binary tree, the pointer current is initialized to ____.

A) nullptr
B) llink
C) rlink
D) root
سؤال
The most common operation performed on a binary tree is a(n) ____.

A) insertion
B) deletion
C) search
D) traversal
سؤال
In copying a binary tree, if you use just the value of the pointer of the root node, you get a ____ copy of the data.

A) static
B) shallow
C) deep
D) local
سؤال
Let T be a binary search tree with n nodes, in which n > 0.When T is linear, the search algorithm makes ____________________ key comparisons, in the unsuccessful case.
سؤال
When a class object is passed by value, the ____________________ constructor copies the value of the actual parameters into the formal parameters.
سؤال
After inserting an item in a binary search tree, the resulting binary tree must be a(n) ____________________.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/43
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 19: Binary Trees
1
In the diagram of a binary tree, an arrow is called a(n) ____.

A) relation
B) path
C) directed line
D) directed branch
D
2
Every node in a binary tree has at most ____ children.

A) one
B) two
C) three
D) four
B
3
A node in a binary tree is called a(n) ____ if it has no left and right children.

A) edge
B) branch
C) leaf
D) path
C
4
The level of the root node of a binary tree is 1.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
5
In a binary tree, the branches go only from a child to a parent.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
6
To delete an item from the binary search tree, you must do the following:1.Find the node containing the item (if any) to be deleted.
2.Delete the node.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
7
Duplicates are allowed in a binary search tree.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
8
Every node in a binary tree has ____ pointers.

A) one
B) two
C) three
D) four
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
9
For classes with pointer data members, you must explicitly overload the assignment operator and include the destructor.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
10
All binary tree traversals start at the left-most child node.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
11
Three lines at the end of an arrow in the diagram of a binary tree indicate that the subtree ____.

A) has three branches
B) has three children
C) is full
D) is empty
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
12
The operations to do inorder, preorder, and postorder traversals of a binary search tree are the same as those for a binary tree.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
13
Consider that A is a binary tree, C and D are the subtrees of A.Which of the following statements is always true?

A) C and D are binary trees.
B) C and D are search binary trees.
C) C and D are empty trees.
D) A is empty.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
14
A pointer to the root node of the binary tree is stored outside the binary tree in a pointer variable, usually called the ____.

A) node
B) parent
C) root
D) nodeType
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
15
The item search, insertion, and deletion operations all require the binary tree to be traversed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
16
In C++, a function name without any parentheses is considered a pointer to the function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
17
In a diagram of a binary tree, each node is represented as a(n) ____.

A) line
B) triangle
C) circle
D) rectangle
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
18
A binary tree has a special node called the ____ node.

A) super
B) root
C) superparent
D) rootleaf
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
19
After deleting the desired item from a binary search tree, the resulting tree must be a binary search tree.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
20
Each link in a binary tree node points to a(n) ____ of that node.

A) parent
B) child
C) value
D) sibling
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
21
A binary tree is empty if root is ____.

A) '0'
B) 1
C) "zero"
D) nullptr
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
22
The sequence of operations in a postorder traversal is ____.

A) traverse left; traverse right
B) traverse left; traverse right; visit
C) visit; traverse left; traverse right
D) traverse left; visit; traverse right
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
23
Assume the key of the left child below the root node of a binary search tree is 30.The value in the root node could be ____.

A) 0
B) 10
C) 30
D) 40
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
24
In a(n) ____________________ traversal, the binary tree is traversed as follows:1.Traverse the left subtree
2.Visit the node
3.Traverse the right subtree
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
25
The three traversal algorithms discussed for binary trees are ____, ____, and ____.

A) order, preorder, postorder
B) in, preorder, order
C) order, preorder, post
D) inorder, preorder, postorder
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
26
In a binary search tree, the data in each node is ____ the data in the left child.

A) larger than
B) smaller than
C) equal to
D) larger or equal to
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
27
In a(n) ____________________ traversal, the binary tree is traversed as follows:1.Visit the node.
2.Traverse the left subtree.
3.Traverse the right subtree.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
28
The listing of the nodes produced by the postorder traversal of a binary tree is called the ____.

A) postsequence
B) postorder sequence
C) postorder table
D) post-script
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
29
A binary tree is also a(n) ____.

A) stack
B) linked list
C) graph
D) array
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
30
The listing of the nodes produced by the preorder traversal of a binary tree is called the ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
31
In addition to the inorder, preorder, and postorder traversals, a binary tree can also be traversed level-by-level, which is also known as ____________________ traversal.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
32
The key of the right child below the root node of a search binary tree is 40.The value in the root node could be ____.

A) 30
B) 40
C) 50
D) 60
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
33
The ____________________ of a binary tree is the number of nodes on the longest path from the root to a leaf.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
34
The search function searches the binary search tree for a given item.If the item is found in the binary search tree, it returns ____.
C) a reference to the node where the item was found
D) 1
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
35
The ____ of a node in a binary tree is the number of branches on the path from the root to the node.

A) height
B) level
C) width
D) size
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
36
In a binary tree, the level of the children of the root node is ____.

A) 0
B) 1
C) 2
D) 3
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
37
The ____________________ of a path in a binary tree is the number of branches on that path.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
38
When traversing a binary tree, the pointer current is initialized to ____.

A) nullptr
B) llink
C) rlink
D) root
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
39
The most common operation performed on a binary tree is a(n) ____.

A) insertion
B) deletion
C) search
D) traversal
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
40
In copying a binary tree, if you use just the value of the pointer of the root node, you get a ____ copy of the data.

A) static
B) shallow
C) deep
D) local
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
41
Let T be a binary search tree with n nodes, in which n > 0.When T is linear, the search algorithm makes ____________________ key comparisons, in the unsuccessful case.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
42
When a class object is passed by value, the ____________________ constructor copies the value of the actual parameters into the formal parameters.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
43
After inserting an item in a binary search tree, the resulting binary tree must be a(n) ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.