Deck 17: Tree Structures

ملء الشاشة (f)
exit full mode
سؤال
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following statements is NOT correct?</strong> A) N is a descendant of R B) N is a descendant of C C) L is a descendant of C D) H is a descendant of M <div style=padding-top: 35px> Which of the following statements is NOT correct?

A) N is a descendant of R
B) N is a descendant of C
C) L is a descendant of C
D) H is a descendant of M
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Consider the following tree diagram: <strong>Consider the following tree diagram:   What is the height of this tree?</strong> A) 3 B) 4 C) 6 D) 7 <div style=padding-top: 35px> What is the height of this tree?

A) 3
B) 4
C) 6
D) 7
سؤال
Which of the following statements about binary trees is correct?

A) Each node in a binary tree has at least two child nodes.
B) Each node in a binary tree has at most two child nodes.
C) The number of child nodes for each node in a binary tree is any power of two.
D) If divided down the middle from top to bottom, a binary tree must be symmetrical.
سؤال
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following statements is NOT correct?</strong> A) Nodes D and K form a subtree B) Nodes H, M, and X form a subtree C) Nodes R and N form a subtree D) Nodes L and T form a subtree <div style=padding-top: 35px> Which of the following statements is NOT correct?

A) Nodes D and K form a subtree
B) Nodes H, M, and X form a subtree
C) Nodes R and N form a subtree
D) Nodes L and T form a subtree
سؤال
Consider the following tree diagram: <strong>Consider the following tree diagram:   What is the size of this tree?</strong> A) 4 B) 5 C) 6 D) 13 <div style=padding-top: 35px> What is the size of this tree?

A) 4
B) 5
C) 6
D) 13
سؤال
As implemented in the textbook, a tree class contains which of the following?
I Node class
II Root node
III List of child nodes

A) I
B) I and II
C) II and III
D) I and III
سؤال
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following nodes are leaf nodes?</strong> A) H B) N C) H and P D) H, N, and P <div style=padding-top: 35px> Which of the following nodes are leaf nodes?

A) H
B) N
C) H and P
D) H, N, and P
سؤال
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following nodes are leaf nodes?</strong> A) C B) B C) H D) B and H <div style=padding-top: 35px> Which of the following nodes are leaf nodes?

A) C
B) B
C) H
D) B and H
سؤال
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following nodes are child nodes?</strong> A) C B) C and R C) R and D D) C, R, and D <div style=padding-top: 35px> Which of the following nodes are child nodes?

A) C
B) C and R
C) R and D
D) C, R, and D
سؤال
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following nodes are siblings?</strong> A) D and U B) H and M C) D and B D) L and T <div style=padding-top: 35px> Which of the following nodes are siblings?

A) D and U
B) H and M
C) D and B
D) L and T
سؤال
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following nodes are root nodes?</strong> A) C B) R C) P D) R and P <div style=padding-top: 35px> Which of the following nodes are root nodes?

A) C
B) R
C) P
D) R and P
سؤال
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following nodes are child nodes?</strong> A) C B) C and X C) P and X D) C and P <div style=padding-top: 35px> Which of the following nodes are child nodes?

A) C
B) C and X
C) P and X
D) C and P
سؤال
Consider the following tree diagram: <strong>Consider the following tree diagram:   What is the height of the subtree with root R?</strong> A) 2 B) 3 C) 4 D) 6 <div style=padding-top: 35px> What is the height of the subtree with root R?

A) 2
B) 3
C) 4
D) 6
سؤال
Consider the following tree diagram: <strong>Consider the following tree diagram:   What is the height of the subtree with root P?</strong> A) 3 B) 4 C) 5 D) 6 <div style=padding-top: 35px> What is the height of the subtree with root P?

A) 3
B) 4
C) 5
D) 6
سؤال
Consider the following tree diagram: <strong>Consider the following tree diagram:   What is the height of this tree?</strong> A) 3 B) 4 C) 5 D) 7 <div style=padding-top: 35px> What is the height of this tree?

A) 3
B) 4
C) 5
D) 7
سؤال
Consider the following tree diagram: <strong>Consider the following tree diagram:   What is the size of the subtree with root P?</strong> A) 3 B) 4 C) 5 D) 6 <div style=padding-top: 35px> What is the size of the subtree with root P?

A) 3
B) 4
C) 5
D) 6
سؤال
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following nodes are interior nodes?</strong> A) C B) N C) C and P D) C, N, and P <div style=padding-top: 35px> Which of the following nodes are interior nodes?

A) C
B) N
C) C and P
D) C, N, and P
سؤال
Consider the following tree diagram: <strong>Consider the following tree diagram:   What is the size of the subtree with root R?</strong> A) 2 B) 3 C) 4 D) 6 <div style=padding-top: 35px> What is the size of the subtree with root R?

A) 2
B) 3
C) 4
D) 6
سؤال
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following statements is NOT correct?</strong> A) R is an ancestor of N B) C is an ancestor of N C) D is an ancestor of P D) H is an ancestor of M <div style=padding-top: 35px> Which of the following statements is NOT correct?

A) R is an ancestor of N
B) C is an ancestor of N
C) D is an ancestor of P
D) H is an ancestor of M
سؤال
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following nodes are parent nodes?</strong> A) C B) C and R C) R and D D) C, R, and D <div style=padding-top: 35px> Which of the following nodes are parent nodes?

A) C
B) C and R
C) R and D
D) C, R, and D
سؤال
A binary tree of height h can have up to ____ nodes.

A) 2h - 1
B) 2h + 1
C) 2h - 1
D) 2h + 1
سؤال
The height h of a completely filled binary tree with n nodes is ____.

A) h = log2(n) - 1
B) h = log2(n) + 1
C) h = log2(n - 1)
D) h = log2(n + 1)
سؤال
Consider the following tree diagram:  <strong>Consider the following tree diagram:   Which arithmetic expression is represented by this tree?</strong> A) (2 + 3) + (5  \times  4)  \times  6  \times  (- 1) B) 2 + 3 + 5  \times  4 - 6 - 1 C) (2 + 3)  \times  (5  \times  4)  \times  (6 - 1) D) [(2 + 3) + (5  \times  4)]  \times  (6 - 1) <div style=padding-top: 35px>
Which arithmetic expression is represented by this tree?

A) (2 + 3) + (5 ×\times 4) ×\times 6 ×\times (- 1)
B) 2 + 3 + 5 ×\times 4 - 6 - 1
C) (2 + 3) ×\times (5 ×\times 4) ×\times (6 - 1)
D) [(2 + 3) + (5 ×\times 4)] ×\times (6 - 1)
سؤال
Consider the following tree diagram:  <strong>Consider the following tree diagram:   Which arithmetic expression is represented by this tree?</strong> A) 2  \times  3 + 5 + 4  \times  6 - 1 B) 2  \times  3 + 5 + 4 - 6 - 1 C) 2  \times  (3 + 5 + 4)  \times  (6 - 1) D) [(2  \times  3) + 5 + 4]  \times  (6 - 1) <div style=padding-top: 35px>  Which arithmetic expression is represented by this tree?

A) 2 ×\times 3 + 5 + 4 ×\times 6 - 1
B) 2 ×\times 3 + 5 + 4 - 6 - 1
C) 2 ×\times (3 + 5 + 4) ×\times (6 - 1)
D) [(2 ×\times 3) + 5 + 4] ×\times (6 - 1)
سؤال
Consider the following tree diagrams: <strong>Consider the following tree diagrams:   Which of these trees is considered to be balanced?</strong> A) I B) I and II C) II and III D) I and III <div style=padding-top: 35px> Which of these trees is considered to be balanced?

A) I
B) I and II
C) II and III
D) I and III
سؤال
Consider the following Huffman encoding tree: <strong>Consider the following Huffman encoding tree:   The letter K will be encoded as ____.</strong> A) 10 B) 010 C) 001 D) 100 <div style=padding-top: 35px> The letter K will be encoded as ____.

A) 10
B) 010
C) 001
D) 100
سؤال
You are using a tree to show the evaluation order of arithmetic expressions. Which of the following statements is NOT correct?

A) Leaves contain numbers.
B) Interior nodes contain numbers.
C) The root contains an operator.
D) Every level of the tree must contain an operator.
سؤال
Consider the following Huffman encoding tree: <strong>Consider the following Huffman encoding tree:   The letter H will be encoded as ____.</strong> A) 000 B) 011 C) 001 D) 010 <div style=padding-top: 35px> The letter H will be encoded as ____.

A) 000
B) 011
C) 001
D) 010
سؤال
If the child references of a binary tree node are both null, the node is ____.

A) a root node
B) a leaf node
C) a parent node
D) an interior node
سؤال
Consider the following tree diagrams: <strong>Consider the following tree diagrams:   Which of these trees is considered to be unbalanced?</strong> A) I B) II C) III D) II and III <div style=padding-top: 35px> Which of these trees is considered to be unbalanced?

A) I
B) II
C) III
D) II and III
سؤال
If both of the child references of a binary tree node are non-null, it follows that the node must be ____.

A) a root node
B) a leaf node
C) a child node
D) an interior node
سؤال
Consider the following tree diagrams: <strong>Consider the following tree diagrams:   Which of the above are binary trees?</strong> A) I B) II C) I and II D) Neither I nor II <div style=padding-top: 35px> Which of the above are binary trees?

A) I
B) II
C) I and II
D) Neither I nor II
سؤال
Consider the following tree diagrams:  <strong>Consider the following tree diagrams:   Which tree represents the arithmetic expression 2  \times  5 + 4?</strong> A) I B) II C) Both I and II D) Neither I nor II <div style=padding-top: 35px>
Which tree represents the arithmetic expression 2 ×\times 5 + 4?

A) I
B) II
C) Both I and II
D) Neither I nor II
سؤال
A completely filled binary tree with a height of 3 has ____ nodes.

A) 6
B) 7
C) 8
D) 12
سؤال
In a binary search tree, where the root node data value = 45, what do we know about the data values of all the descendants in the left subtree of the root?

A) the root's left child value < 45, but the right child of the root's left child value is > 45
B) some values will be < 45, but there may be a few values > 45
C) approximately half the values are < 45, the other half are > 45
D) all will be < 45
سؤال
Consider the following tree diagrams:  <strong>Consider the following tree diagrams:   Which tree represents the arithmetic expression 2 + 5  \times  4?</strong> A) I B) II C) Both I and II D) Neither I nor II <div style=padding-top: 35px>
Which tree represents the arithmetic expression 2 + 5 ×\times 4?

A) I
B) II
C) Both I and II
D) Neither I nor II
سؤال
A completely filled binary tree with a height of 4 has ____ nodes.

A) 8
B) 12
C) 15
D) 16
سؤال
A binary tree with 260 nodes has a height of approximately ____.

A) 8
B) 10
C) 12
D) 13
سؤال
Consider the following tree diagrams:  <strong>Consider the following tree diagrams:   Which tree represents the arithmetic expression (2 + 5) \times  4?</strong> A) I B) II C) Both I and II D) Neither I nor II <div style=padding-top: 35px>
Which tree represents the arithmetic expression (2 + 5) ×\times 4?

A) I
B) II
C) Both I and II
D) Neither I nor II
سؤال
A binary tree with 520 nodes has a height of approximately ____.

A) 9
B) 10
C) 12
D) 13
سؤال
Consider the following binary search tree diagram: <strong>Consider the following binary search tree diagram:   If node Y is to be removed, which action should be taken? Use the technique presented in the textbook.</strong> A) Modify the V's left reference to point to X. B) Modify the V's right reference to point to X. C) Swap the values in V and X, and modify X's right reference to point to V. D) Modify V to have a null right pointer. <div style=padding-top: 35px> If node Y is to be removed, which action should be taken? Use the technique presented in the textbook.

A) Modify the V's left reference to point to X.
B) Modify the V's right reference to point to X.
C) Swap the values in V and X, and modify X's right reference to point to V.
D) Modify V to have a null right pointer.
سؤال
Consider the following binary search tree diagram: <strong>Consider the following binary search tree diagram:   Which nodes will be visited in order to insert the letter B into this tree?</strong> A) H B) H and D C) H, D, and F D) H, D, and A <div style=padding-top: 35px> Which nodes will be visited in order to insert the letter B into this tree?

A) H
B) H and D
C) H, D, and F
D) H, D, and A
سؤال
Which of the following may occur as a result of an add operation, on a non-empty binary search tree?
I a new root is created
II the new node becomes the left child of the root
III the new node has a right child upon insertion

A) I
B) II
C) III
D) II and III
سؤال
Consider the following binary search tree diagram: <strong>Consider the following binary search tree diagram:   If node J is to be removed, which node should be copied into its location?</strong> A) M B) L C) X D) N <div style=padding-top: 35px> If node J is to be removed, which node should be copied into its location?

A) M
B) L
C) X
D) N
سؤال
Consider the following tree diagrams: <strong>Consider the following tree diagrams:   Which of the above are binary search trees?</strong> A) I B) II C) I and II D) Neither I nor II <div style=padding-top: 35px> Which of the above are binary search trees?

A) I
B) II
C) I and II
D) Neither I nor II
سؤال
Consider the following binary search tree diagram: <strong>Consider the following binary search tree diagram:   If node F is to be removed, which action should be taken? Use the technique presented in the textbook.</strong> A) Move C into the right subtree of D. B) Move C into the left subtree of A. C) Replace F with D's value and replace D with C's value. D) Modify D to have a null right reference. <div style=padding-top: 35px> If node F is to be removed, which action should be taken? Use the technique presented in the textbook.

A) Move C into the right subtree of D.
B) Move C into the left subtree of A.
C) Replace F with D's value and replace D with C's value.
D) Modify D to have a null right reference.
سؤال
Which of the following statements about a binary search tree is correct?

A) Adding elements that are already sorted will result in a balanced binary search tree.
B) Nodes must be moved when a node is removed from the middle of a subtree.
C) The speed of inserting or removing a node is dependent on the shape of the tree.
D) The speed of inserting or removing a node is dependent on the number of subtrees.
سؤال
What does the left node reference of a newly inserted binary search tree node get set to?

A) depends where the node is inserted
B) it gets set to the left child of the new node, if one exists
C) always null
D) it gets set to the left child of the root, if it exists
سؤال
Consider the following binary search tree diagram: <strong>Consider the following binary search tree diagram:   If node D is to be removed, which action should be taken? Use the technique presented in the textbook.</strong> A) Modify K to point to A as its left child, and modify A to point to F as its right child. B) Modify K to make its left child null. C) Swap the values in C and D so that C has A as its left child, then remove the new D node. D) Modify K to point to F as its left child and modify F to point to A as its left child. <div style=padding-top: 35px> If node D is to be removed, which action should be taken? Use the technique presented in the textbook.

A) Modify K to point to A as its left child, and modify A to point to F as its right child.
B) Modify K to make its left child null.
C) Swap the values in C and D so that C has A as its left child, then remove the new D node.
D) Modify K to point to F as its left child and modify F to point to A as its left child.
سؤال
Consider the following tree diagrams: <strong>Consider the following tree diagrams:   Which are binary search trees?</strong> A) I B) II C) I and II D) Neither I nor II <div style=padding-top: 35px> Which are binary search trees?

A) I
B) II
C) I and II
D) Neither I nor II
سؤال
Which of the following sequences of insertions will result in a balanced tree?
I 12 , 7, 25, 6, 9, 13, 44
II 12 , 7, 25, 44, 13, 6, 9
III 12, 25, 44, 13, 6, 9, 7

A) I
B) II
C) I and II
D) I and III
سؤال
Consider the following binary search tree diagram: <strong>Consider the following binary search tree diagram:   Which of the following trees represents the correct result after inserting element T?  </strong> A) I B) II C) III D) IV <div style=padding-top: 35px> Which of the following trees represents the correct result after inserting element T? <strong>Consider the following binary search tree diagram:   Which of the following trees represents the correct result after inserting element T?  </strong> A) I B) II C) III D) IV <div style=padding-top: 35px>

A) I
B) II
C) III
D) IV
سؤال
Consider the following binary search tree diagram: <strong>Consider the following binary search tree diagram:   Which of the following trees represents the correct result after inserting element B?  </strong> A) I B) II C) III D) IV <div style=padding-top: 35px> Which of the following trees represents the correct result after inserting element B? <strong>Consider the following binary search tree diagram:   Which of the following trees represents the correct result after inserting element B?  </strong> A) I B) II C) III D) IV <div style=padding-top: 35px>

A) I
B) II
C) III
D) IV
سؤال
Consider the following binary search tree diagram: <strong>Consider the following binary search tree diagram:   Which nodes will be visited in order to insert the letter E into this tree?</strong> A) H B) H and D C) H, D, and F D) H, D, and A <div style=padding-top: 35px> Which nodes will be visited in order to insert the letter E into this tree?

A) H
B) H and D
C) H, D, and F
D) H, D, and A
سؤال
The nodes in our binary search tree implement the Comparable interface. Which tree operations benefit from this design decision?
I add
II search
III delete

A) I
B) II
C) I and III
D) I, II and III
سؤال
Locating an element in a balanced binary search tree takes ____ time.

A) O(n)
B) O(log(n))
C) O(1)
D) O(n2)
سؤال
In a binary search tree, where the root node data value = 45, what do we know about the values of all the descendants in the right subtree of the root?

A) the root's right child value > 45, but the left child of the root's right child key is < 45
B) some values will be > 45, but there may be a few values < 45
C) approximately half the values are < 45, the other half are > 45
D) all will be > 45
سؤال
A binary search tree is made up of a collection of nodes organized with smaller data values on the left and greater values on the right relative to any node. Which of the following Node references must be instance variables of any implementation of a Node class?
I root
II left
III right

A) I
B) II and III
C) I and II
D) I, II and III
سؤال
A binary search tree is made up of a collection of nodes organized with smaller data values on the left and greater values on the right, relative to any node. Which of the following Node references must be instance variables of any implementation of a BinarySearchTree class?
I root
II left
III right

A) I
B) II and III
C) I and II
D) I, II and III
سؤال
Consider the following binary search tree diagram: <strong>Consider the following binary search tree diagram:   If node M is to be removed, which action should be taken?</strong> A) Replace M with the smallest value in its left subtree. B) Replace M with the smallest value in its right subtree. C) Replace M with the largest value in its left subtree. D) Replace M with the largest value in its right subtree. <div style=padding-top: 35px> If node M is to be removed, which action should be taken?

A) Replace M with the smallest value in its left subtree.
B) Replace M with the smallest value in its right subtree.
C) Replace M with the largest value in its left subtree.
D) Replace M with the largest value in its right subtree.
سؤال
What are the differences between preorder, postorder, and inorder traversals?

A) The order in which we visit the left and right subtrees
B) Preorder only visits the left subtree
C) Postorder only visits the right subtree
D) The order of the root visit
سؤال
Consider the following binary search tree: <strong>Consider the following binary search tree:   Which of the following sequences correctly represents postorder traversal of this tree?</strong> A) J, E, M, A, G, P, C, H, N B) A, C, H, G, E, N, P, M, J C) J, E, A, G, C, H, M, P, N D) A, C, E, G, H, J, M, N, P <div style=padding-top: 35px> Which of the following sequences correctly represents postorder traversal of this tree?

A) J, E, M, A, G, P, C, H, N
B) A, C, H, G, E, N, P, M, J
C) J, E, A, G, C, H, M, P, N
D) A, C, E, G, H, J, M, N, P
سؤال
Adding an element to a balanced binary search tree takes ____ time.

A) O(n)
B) O(log (n))
C) O(1)
D) O(n2)
سؤال
You wish to traverse a binary search tree in sorted order. Which of the following schemes will accomplish this?
I inorder traversal
II preorder traversal
III postorder traversal

A) I
B) II
C) III
D) II and III
سؤال
If the postorder traversal visits the nodes of a binary tree storing character values in the order of U, G, T, R, A, I, what is the value of the root of the tree?

A) I
B) U
C) T
D) cannot be determined
سؤال
You wish to traverse a binary search tree in sorted order using inorder traversal. Arrange the following actions in the correct order to accomplish this.
I Print the right subtree recursively
II Print the root
III Print the left subtree recursively

A) I, II, III
B) III, II, I
C) II, III, I
D) III, I, II
سؤال
Consider the following binary search tree: <strong>Consider the following binary search tree:   Which of the following sequences correctly represents breadth-first traversal of this tree?</strong> A) J, E, M, A, G, P, C, H, N B) A, C, H, G, E, N, P, M, J C) J, E, A, G, C, H, M, P, N D) A, C, E, G, H, J, M, N, P <div style=padding-top: 35px> Which of the following sequences correctly represents breadth-first traversal of this tree?

A) J, E, M, A, G, P, C, H, N
B) A, C, H, G, E, N, P, M, J
C) J, E, A, G, C, H, M, P, N
D) A, C, E, G, H, J, M, N, P
سؤال
Locating an element in an unbalanced binary search tree takes ____ time.

A) O(n)
B) O(log (n))
C) O(1)
D) O(n2)
سؤال
Which of the following statements about the three tree traversal schemes studied, is correct?

A) Preorder traversal is used for evaluating arithmetic expression trees on a stack-based calculator.
B) Postorder traversal is used for evaluating arithmetic expression trees on a stack-based calculator.
C) Postorder traversal is used for copying file directories.
D) Preorder traversal is used for removing file directories by removing subdirectories first.
سؤال
Adding an element to an unbalanced binary search tree takes ____ time.

A) O(n)
B) O(log (n))
C) O(1)
D) O(n2)
سؤال
Which of the following statements about the three tree traversal schemes studied is correct?

A) Inorder traversal is used for evaluating arithmetic expression trees on a stack-based calculator.
B) Postorder traversal is used for copying file directories.
C) Inorder traversal is used for copying file directories.
D) Postorder traversal is used for removing file directories by removing subdirectories first.
سؤال
If the postorder traversal of an expression tree is, 8, 2, +, 5, /, what is the result of an inorder traversal?

A) +, /, 8, 2, 5
B) /, +, 8, 2, 5
C) 8, +, 2, /, 5
D) /, +, 2, 8, 5
سؤال
Removing an element from a balanced binary search tree takes ____ time.

A) O(n)
B) O(log (n))
C) O(1)
D) O(n2)
سؤال
Removing an element from an unbalanced binary search tree takes ____ time.

A) O(n)
B) O(log (n))
C) O(1)
D) O(n2)
سؤال
Consider the following binary search tree: <strong>Consider the following binary search tree:   Which of the following sequences correctly represents preorder traversal of this tree?</strong> A) J, E, M, A, G, P, C, H, N B) A, C, H, G, E, N, P, M, J C) J, E, A, G, C, H, M, P, N D) A, C, E, G, H, J, M, N, P <div style=padding-top: 35px> Which of the following sequences correctly represents preorder traversal of this tree?

A) J, E, M, A, G, P, C, H, N
B) A, C, H, G, E, N, P, M, J
C) J, E, A, G, C, H, M, P, N
D) A, C, E, G, H, J, M, N, P
سؤال
If the postorder traversal visits the nodes of a binary tree storing character values in the order of
U, G, T, R, A, I, what is the visit order for an inorder traversal of the same binary tree?

A) I, G, U, A, T, R
B) R, G, U, I, T, A
C) G, U, I, T, A, R
D) cannot be determined
سؤال
If the postorder traversal of an expression tree is 8, 2, +, 5, /, what is the numeric result of that Reverse Polish Notation expression?

A) 15
B) 8
C) 7
D) 2
سؤال
You wish to traverse a binary search tree in sorted order using preorder traversal. Arrange the following actions in the correct order to accomplish this.
I Print the right subtree recursively
II Print the root
III Print the left subtree recursively

A) I, II, III
B) III, II, I
C) II, III, I
D) III, I, II
سؤال
If the postorder traversal of an expression tree is 8, 2, +, 5, /, what is the preorder traversal?

A) +, /, 8, 2, 5
B) /, +, 8, 2, 5
C) 8, +, 2, /, 5
D) /, +, 2, 8, 5
سؤال
You wish to traverse a binary search tree using postorder traversal. Arrange the following actions in the correct order to accomplish this.
I Print the right subtree recursively
II Print the root
III Print the left subtree recursively

A) I, II, III
B) III, II, I
C) II, III, I
D) III, I, II
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/100
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 17: Tree Structures
1
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following statements is NOT correct?</strong> A) N is a descendant of R B) N is a descendant of C C) L is a descendant of C D) H is a descendant of M Which of the following statements is NOT correct?

A) N is a descendant of R
B) N is a descendant of C
C) L is a descendant of C
D) H is a descendant of M
D
2
Consider the following tree diagram: <strong>Consider the following tree diagram:   What is the height of this tree?</strong> A) 3 B) 4 C) 6 D) 7 What is the height of this tree?

A) 3
B) 4
C) 6
D) 7
B
3
Which of the following statements about binary trees is correct?

A) Each node in a binary tree has at least two child nodes.
B) Each node in a binary tree has at most two child nodes.
C) The number of child nodes for each node in a binary tree is any power of two.
D) If divided down the middle from top to bottom, a binary tree must be symmetrical.
B
4
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following statements is NOT correct?</strong> A) Nodes D and K form a subtree B) Nodes H, M, and X form a subtree C) Nodes R and N form a subtree D) Nodes L and T form a subtree Which of the following statements is NOT correct?

A) Nodes D and K form a subtree
B) Nodes H, M, and X form a subtree
C) Nodes R and N form a subtree
D) Nodes L and T form a subtree
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
5
Consider the following tree diagram: <strong>Consider the following tree diagram:   What is the size of this tree?</strong> A) 4 B) 5 C) 6 D) 13 What is the size of this tree?

A) 4
B) 5
C) 6
D) 13
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
6
As implemented in the textbook, a tree class contains which of the following?
I Node class
II Root node
III List of child nodes

A) I
B) I and II
C) II and III
D) I and III
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
7
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following nodes are leaf nodes?</strong> A) H B) N C) H and P D) H, N, and P Which of the following nodes are leaf nodes?

A) H
B) N
C) H and P
D) H, N, and P
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
8
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following nodes are leaf nodes?</strong> A) C B) B C) H D) B and H Which of the following nodes are leaf nodes?

A) C
B) B
C) H
D) B and H
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
9
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following nodes are child nodes?</strong> A) C B) C and R C) R and D D) C, R, and D Which of the following nodes are child nodes?

A) C
B) C and R
C) R and D
D) C, R, and D
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
10
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following nodes are siblings?</strong> A) D and U B) H and M C) D and B D) L and T Which of the following nodes are siblings?

A) D and U
B) H and M
C) D and B
D) L and T
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
11
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following nodes are root nodes?</strong> A) C B) R C) P D) R and P Which of the following nodes are root nodes?

A) C
B) R
C) P
D) R and P
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
12
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following nodes are child nodes?</strong> A) C B) C and X C) P and X D) C and P Which of the following nodes are child nodes?

A) C
B) C and X
C) P and X
D) C and P
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
13
Consider the following tree diagram: <strong>Consider the following tree diagram:   What is the height of the subtree with root R?</strong> A) 2 B) 3 C) 4 D) 6 What is the height of the subtree with root R?

A) 2
B) 3
C) 4
D) 6
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
14
Consider the following tree diagram: <strong>Consider the following tree diagram:   What is the height of the subtree with root P?</strong> A) 3 B) 4 C) 5 D) 6 What is the height of the subtree with root P?

A) 3
B) 4
C) 5
D) 6
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
15
Consider the following tree diagram: <strong>Consider the following tree diagram:   What is the height of this tree?</strong> A) 3 B) 4 C) 5 D) 7 What is the height of this tree?

A) 3
B) 4
C) 5
D) 7
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
16
Consider the following tree diagram: <strong>Consider the following tree diagram:   What is the size of the subtree with root P?</strong> A) 3 B) 4 C) 5 D) 6 What is the size of the subtree with root P?

A) 3
B) 4
C) 5
D) 6
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
17
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following nodes are interior nodes?</strong> A) C B) N C) C and P D) C, N, and P Which of the following nodes are interior nodes?

A) C
B) N
C) C and P
D) C, N, and P
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
18
Consider the following tree diagram: <strong>Consider the following tree diagram:   What is the size of the subtree with root R?</strong> A) 2 B) 3 C) 4 D) 6 What is the size of the subtree with root R?

A) 2
B) 3
C) 4
D) 6
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
19
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following statements is NOT correct?</strong> A) R is an ancestor of N B) C is an ancestor of N C) D is an ancestor of P D) H is an ancestor of M Which of the following statements is NOT correct?

A) R is an ancestor of N
B) C is an ancestor of N
C) D is an ancestor of P
D) H is an ancestor of M
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
20
Consider the following tree diagram: <strong>Consider the following tree diagram:   Which of the following nodes are parent nodes?</strong> A) C B) C and R C) R and D D) C, R, and D Which of the following nodes are parent nodes?

A) C
B) C and R
C) R and D
D) C, R, and D
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
21
A binary tree of height h can have up to ____ nodes.

A) 2h - 1
B) 2h + 1
C) 2h - 1
D) 2h + 1
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
22
The height h of a completely filled binary tree with n nodes is ____.

A) h = log2(n) - 1
B) h = log2(n) + 1
C) h = log2(n - 1)
D) h = log2(n + 1)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
23
Consider the following tree diagram:  <strong>Consider the following tree diagram:   Which arithmetic expression is represented by this tree?</strong> A) (2 + 3) + (5  \times  4)  \times  6  \times  (- 1) B) 2 + 3 + 5  \times  4 - 6 - 1 C) (2 + 3)  \times  (5  \times  4)  \times  (6 - 1) D) [(2 + 3) + (5  \times  4)]  \times  (6 - 1)
Which arithmetic expression is represented by this tree?

A) (2 + 3) + (5 ×\times 4) ×\times 6 ×\times (- 1)
B) 2 + 3 + 5 ×\times 4 - 6 - 1
C) (2 + 3) ×\times (5 ×\times 4) ×\times (6 - 1)
D) [(2 + 3) + (5 ×\times 4)] ×\times (6 - 1)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
24
Consider the following tree diagram:  <strong>Consider the following tree diagram:   Which arithmetic expression is represented by this tree?</strong> A) 2  \times  3 + 5 + 4  \times  6 - 1 B) 2  \times  3 + 5 + 4 - 6 - 1 C) 2  \times  (3 + 5 + 4)  \times  (6 - 1) D) [(2  \times  3) + 5 + 4]  \times  (6 - 1)  Which arithmetic expression is represented by this tree?

A) 2 ×\times 3 + 5 + 4 ×\times 6 - 1
B) 2 ×\times 3 + 5 + 4 - 6 - 1
C) 2 ×\times (3 + 5 + 4) ×\times (6 - 1)
D) [(2 ×\times 3) + 5 + 4] ×\times (6 - 1)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
25
Consider the following tree diagrams: <strong>Consider the following tree diagrams:   Which of these trees is considered to be balanced?</strong> A) I B) I and II C) II and III D) I and III Which of these trees is considered to be balanced?

A) I
B) I and II
C) II and III
D) I and III
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
26
Consider the following Huffman encoding tree: <strong>Consider the following Huffman encoding tree:   The letter K will be encoded as ____.</strong> A) 10 B) 010 C) 001 D) 100 The letter K will be encoded as ____.

A) 10
B) 010
C) 001
D) 100
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
27
You are using a tree to show the evaluation order of arithmetic expressions. Which of the following statements is NOT correct?

A) Leaves contain numbers.
B) Interior nodes contain numbers.
C) The root contains an operator.
D) Every level of the tree must contain an operator.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
28
Consider the following Huffman encoding tree: <strong>Consider the following Huffman encoding tree:   The letter H will be encoded as ____.</strong> A) 000 B) 011 C) 001 D) 010 The letter H will be encoded as ____.

A) 000
B) 011
C) 001
D) 010
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
29
If the child references of a binary tree node are both null, the node is ____.

A) a root node
B) a leaf node
C) a parent node
D) an interior node
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
30
Consider the following tree diagrams: <strong>Consider the following tree diagrams:   Which of these trees is considered to be unbalanced?</strong> A) I B) II C) III D) II and III Which of these trees is considered to be unbalanced?

A) I
B) II
C) III
D) II and III
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
31
If both of the child references of a binary tree node are non-null, it follows that the node must be ____.

A) a root node
B) a leaf node
C) a child node
D) an interior node
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
32
Consider the following tree diagrams: <strong>Consider the following tree diagrams:   Which of the above are binary trees?</strong> A) I B) II C) I and II D) Neither I nor II Which of the above are binary trees?

A) I
B) II
C) I and II
D) Neither I nor II
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
33
Consider the following tree diagrams:  <strong>Consider the following tree diagrams:   Which tree represents the arithmetic expression 2  \times  5 + 4?</strong> A) I B) II C) Both I and II D) Neither I nor II
Which tree represents the arithmetic expression 2 ×\times 5 + 4?

A) I
B) II
C) Both I and II
D) Neither I nor II
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
34
A completely filled binary tree with a height of 3 has ____ nodes.

A) 6
B) 7
C) 8
D) 12
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
35
In a binary search tree, where the root node data value = 45, what do we know about the data values of all the descendants in the left subtree of the root?

A) the root's left child value < 45, but the right child of the root's left child value is > 45
B) some values will be < 45, but there may be a few values > 45
C) approximately half the values are < 45, the other half are > 45
D) all will be < 45
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
36
Consider the following tree diagrams:  <strong>Consider the following tree diagrams:   Which tree represents the arithmetic expression 2 + 5  \times  4?</strong> A) I B) II C) Both I and II D) Neither I nor II
Which tree represents the arithmetic expression 2 + 5 ×\times 4?

A) I
B) II
C) Both I and II
D) Neither I nor II
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
37
A completely filled binary tree with a height of 4 has ____ nodes.

A) 8
B) 12
C) 15
D) 16
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
38
A binary tree with 260 nodes has a height of approximately ____.

A) 8
B) 10
C) 12
D) 13
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
39
Consider the following tree diagrams:  <strong>Consider the following tree diagrams:   Which tree represents the arithmetic expression (2 + 5) \times  4?</strong> A) I B) II C) Both I and II D) Neither I nor II
Which tree represents the arithmetic expression (2 + 5) ×\times 4?

A) I
B) II
C) Both I and II
D) Neither I nor II
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
40
A binary tree with 520 nodes has a height of approximately ____.

A) 9
B) 10
C) 12
D) 13
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
41
Consider the following binary search tree diagram: <strong>Consider the following binary search tree diagram:   If node Y is to be removed, which action should be taken? Use the technique presented in the textbook.</strong> A) Modify the V's left reference to point to X. B) Modify the V's right reference to point to X. C) Swap the values in V and X, and modify X's right reference to point to V. D) Modify V to have a null right pointer. If node Y is to be removed, which action should be taken? Use the technique presented in the textbook.

A) Modify the V's left reference to point to X.
B) Modify the V's right reference to point to X.
C) Swap the values in V and X, and modify X's right reference to point to V.
D) Modify V to have a null right pointer.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
42
Consider the following binary search tree diagram: <strong>Consider the following binary search tree diagram:   Which nodes will be visited in order to insert the letter B into this tree?</strong> A) H B) H and D C) H, D, and F D) H, D, and A Which nodes will be visited in order to insert the letter B into this tree?

A) H
B) H and D
C) H, D, and F
D) H, D, and A
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
43
Which of the following may occur as a result of an add operation, on a non-empty binary search tree?
I a new root is created
II the new node becomes the left child of the root
III the new node has a right child upon insertion

A) I
B) II
C) III
D) II and III
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
44
Consider the following binary search tree diagram: <strong>Consider the following binary search tree diagram:   If node J is to be removed, which node should be copied into its location?</strong> A) M B) L C) X D) N If node J is to be removed, which node should be copied into its location?

A) M
B) L
C) X
D) N
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
45
Consider the following tree diagrams: <strong>Consider the following tree diagrams:   Which of the above are binary search trees?</strong> A) I B) II C) I and II D) Neither I nor II Which of the above are binary search trees?

A) I
B) II
C) I and II
D) Neither I nor II
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
46
Consider the following binary search tree diagram: <strong>Consider the following binary search tree diagram:   If node F is to be removed, which action should be taken? Use the technique presented in the textbook.</strong> A) Move C into the right subtree of D. B) Move C into the left subtree of A. C) Replace F with D's value and replace D with C's value. D) Modify D to have a null right reference. If node F is to be removed, which action should be taken? Use the technique presented in the textbook.

A) Move C into the right subtree of D.
B) Move C into the left subtree of A.
C) Replace F with D's value and replace D with C's value.
D) Modify D to have a null right reference.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
47
Which of the following statements about a binary search tree is correct?

A) Adding elements that are already sorted will result in a balanced binary search tree.
B) Nodes must be moved when a node is removed from the middle of a subtree.
C) The speed of inserting or removing a node is dependent on the shape of the tree.
D) The speed of inserting or removing a node is dependent on the number of subtrees.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
48
What does the left node reference of a newly inserted binary search tree node get set to?

A) depends where the node is inserted
B) it gets set to the left child of the new node, if one exists
C) always null
D) it gets set to the left child of the root, if it exists
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
49
Consider the following binary search tree diagram: <strong>Consider the following binary search tree diagram:   If node D is to be removed, which action should be taken? Use the technique presented in the textbook.</strong> A) Modify K to point to A as its left child, and modify A to point to F as its right child. B) Modify K to make its left child null. C) Swap the values in C and D so that C has A as its left child, then remove the new D node. D) Modify K to point to F as its left child and modify F to point to A as its left child. If node D is to be removed, which action should be taken? Use the technique presented in the textbook.

A) Modify K to point to A as its left child, and modify A to point to F as its right child.
B) Modify K to make its left child null.
C) Swap the values in C and D so that C has A as its left child, then remove the new D node.
D) Modify K to point to F as its left child and modify F to point to A as its left child.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
50
Consider the following tree diagrams: <strong>Consider the following tree diagrams:   Which are binary search trees?</strong> A) I B) II C) I and II D) Neither I nor II Which are binary search trees?

A) I
B) II
C) I and II
D) Neither I nor II
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
51
Which of the following sequences of insertions will result in a balanced tree?
I 12 , 7, 25, 6, 9, 13, 44
II 12 , 7, 25, 44, 13, 6, 9
III 12, 25, 44, 13, 6, 9, 7

A) I
B) II
C) I and II
D) I and III
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
52
Consider the following binary search tree diagram: <strong>Consider the following binary search tree diagram:   Which of the following trees represents the correct result after inserting element T?  </strong> A) I B) II C) III D) IV Which of the following trees represents the correct result after inserting element T? <strong>Consider the following binary search tree diagram:   Which of the following trees represents the correct result after inserting element T?  </strong> A) I B) II C) III D) IV

A) I
B) II
C) III
D) IV
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
53
Consider the following binary search tree diagram: <strong>Consider the following binary search tree diagram:   Which of the following trees represents the correct result after inserting element B?  </strong> A) I B) II C) III D) IV Which of the following trees represents the correct result after inserting element B? <strong>Consider the following binary search tree diagram:   Which of the following trees represents the correct result after inserting element B?  </strong> A) I B) II C) III D) IV

A) I
B) II
C) III
D) IV
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
54
Consider the following binary search tree diagram: <strong>Consider the following binary search tree diagram:   Which nodes will be visited in order to insert the letter E into this tree?</strong> A) H B) H and D C) H, D, and F D) H, D, and A Which nodes will be visited in order to insert the letter E into this tree?

A) H
B) H and D
C) H, D, and F
D) H, D, and A
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
55
The nodes in our binary search tree implement the Comparable interface. Which tree operations benefit from this design decision?
I add
II search
III delete

A) I
B) II
C) I and III
D) I, II and III
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
56
Locating an element in a balanced binary search tree takes ____ time.

A) O(n)
B) O(log(n))
C) O(1)
D) O(n2)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
57
In a binary search tree, where the root node data value = 45, what do we know about the values of all the descendants in the right subtree of the root?

A) the root's right child value > 45, but the left child of the root's right child key is < 45
B) some values will be > 45, but there may be a few values < 45
C) approximately half the values are < 45, the other half are > 45
D) all will be > 45
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
58
A binary search tree is made up of a collection of nodes organized with smaller data values on the left and greater values on the right relative to any node. Which of the following Node references must be instance variables of any implementation of a Node class?
I root
II left
III right

A) I
B) II and III
C) I and II
D) I, II and III
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
59
A binary search tree is made up of a collection of nodes organized with smaller data values on the left and greater values on the right, relative to any node. Which of the following Node references must be instance variables of any implementation of a BinarySearchTree class?
I root
II left
III right

A) I
B) II and III
C) I and II
D) I, II and III
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
60
Consider the following binary search tree diagram: <strong>Consider the following binary search tree diagram:   If node M is to be removed, which action should be taken?</strong> A) Replace M with the smallest value in its left subtree. B) Replace M with the smallest value in its right subtree. C) Replace M with the largest value in its left subtree. D) Replace M with the largest value in its right subtree. If node M is to be removed, which action should be taken?

A) Replace M with the smallest value in its left subtree.
B) Replace M with the smallest value in its right subtree.
C) Replace M with the largest value in its left subtree.
D) Replace M with the largest value in its right subtree.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
61
What are the differences between preorder, postorder, and inorder traversals?

A) The order in which we visit the left and right subtrees
B) Preorder only visits the left subtree
C) Postorder only visits the right subtree
D) The order of the root visit
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
62
Consider the following binary search tree: <strong>Consider the following binary search tree:   Which of the following sequences correctly represents postorder traversal of this tree?</strong> A) J, E, M, A, G, P, C, H, N B) A, C, H, G, E, N, P, M, J C) J, E, A, G, C, H, M, P, N D) A, C, E, G, H, J, M, N, P Which of the following sequences correctly represents postorder traversal of this tree?

A) J, E, M, A, G, P, C, H, N
B) A, C, H, G, E, N, P, M, J
C) J, E, A, G, C, H, M, P, N
D) A, C, E, G, H, J, M, N, P
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
63
Adding an element to a balanced binary search tree takes ____ time.

A) O(n)
B) O(log (n))
C) O(1)
D) O(n2)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
64
You wish to traverse a binary search tree in sorted order. Which of the following schemes will accomplish this?
I inorder traversal
II preorder traversal
III postorder traversal

A) I
B) II
C) III
D) II and III
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
65
If the postorder traversal visits the nodes of a binary tree storing character values in the order of U, G, T, R, A, I, what is the value of the root of the tree?

A) I
B) U
C) T
D) cannot be determined
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
66
You wish to traverse a binary search tree in sorted order using inorder traversal. Arrange the following actions in the correct order to accomplish this.
I Print the right subtree recursively
II Print the root
III Print the left subtree recursively

A) I, II, III
B) III, II, I
C) II, III, I
D) III, I, II
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
67
Consider the following binary search tree: <strong>Consider the following binary search tree:   Which of the following sequences correctly represents breadth-first traversal of this tree?</strong> A) J, E, M, A, G, P, C, H, N B) A, C, H, G, E, N, P, M, J C) J, E, A, G, C, H, M, P, N D) A, C, E, G, H, J, M, N, P Which of the following sequences correctly represents breadth-first traversal of this tree?

A) J, E, M, A, G, P, C, H, N
B) A, C, H, G, E, N, P, M, J
C) J, E, A, G, C, H, M, P, N
D) A, C, E, G, H, J, M, N, P
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
68
Locating an element in an unbalanced binary search tree takes ____ time.

A) O(n)
B) O(log (n))
C) O(1)
D) O(n2)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
69
Which of the following statements about the three tree traversal schemes studied, is correct?

A) Preorder traversal is used for evaluating arithmetic expression trees on a stack-based calculator.
B) Postorder traversal is used for evaluating arithmetic expression trees on a stack-based calculator.
C) Postorder traversal is used for copying file directories.
D) Preorder traversal is used for removing file directories by removing subdirectories first.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
70
Adding an element to an unbalanced binary search tree takes ____ time.

A) O(n)
B) O(log (n))
C) O(1)
D) O(n2)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
71
Which of the following statements about the three tree traversal schemes studied is correct?

A) Inorder traversal is used for evaluating arithmetic expression trees on a stack-based calculator.
B) Postorder traversal is used for copying file directories.
C) Inorder traversal is used for copying file directories.
D) Postorder traversal is used for removing file directories by removing subdirectories first.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
72
If the postorder traversal of an expression tree is, 8, 2, +, 5, /, what is the result of an inorder traversal?

A) +, /, 8, 2, 5
B) /, +, 8, 2, 5
C) 8, +, 2, /, 5
D) /, +, 2, 8, 5
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
73
Removing an element from a balanced binary search tree takes ____ time.

A) O(n)
B) O(log (n))
C) O(1)
D) O(n2)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
74
Removing an element from an unbalanced binary search tree takes ____ time.

A) O(n)
B) O(log (n))
C) O(1)
D) O(n2)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
75
Consider the following binary search tree: <strong>Consider the following binary search tree:   Which of the following sequences correctly represents preorder traversal of this tree?</strong> A) J, E, M, A, G, P, C, H, N B) A, C, H, G, E, N, P, M, J C) J, E, A, G, C, H, M, P, N D) A, C, E, G, H, J, M, N, P Which of the following sequences correctly represents preorder traversal of this tree?

A) J, E, M, A, G, P, C, H, N
B) A, C, H, G, E, N, P, M, J
C) J, E, A, G, C, H, M, P, N
D) A, C, E, G, H, J, M, N, P
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
76
If the postorder traversal visits the nodes of a binary tree storing character values in the order of
U, G, T, R, A, I, what is the visit order for an inorder traversal of the same binary tree?

A) I, G, U, A, T, R
B) R, G, U, I, T, A
C) G, U, I, T, A, R
D) cannot be determined
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
77
If the postorder traversal of an expression tree is 8, 2, +, 5, /, what is the numeric result of that Reverse Polish Notation expression?

A) 15
B) 8
C) 7
D) 2
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
78
You wish to traverse a binary search tree in sorted order using preorder traversal. Arrange the following actions in the correct order to accomplish this.
I Print the right subtree recursively
II Print the root
III Print the left subtree recursively

A) I, II, III
B) III, II, I
C) II, III, I
D) III, I, II
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
79
If the postorder traversal of an expression tree is 8, 2, +, 5, /, what is the preorder traversal?

A) +, /, 8, 2, 5
B) /, +, 8, 2, 5
C) 8, +, 2, /, 5
D) /, +, 2, 8, 5
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
80
You wish to traverse a binary search tree using postorder traversal. Arrange the following actions in the correct order to accomplish this.
I Print the right subtree recursively
II Print the root
III Print the left subtree recursively

A) I, II, III
B) III, II, I
C) II, III, I
D) III, I, II
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 100 في هذه المجموعة.