QUESTION 8 In the _____ traversal, the root is processed first,before its subtrees. breadth first preorder postorder
Question:
QUESTION 8
In the _____ traversal, the root is processed first,before its subtrees.
breadth first
preorder
postorder
inorder
0.10000 points
QUESTION 9
What kind of traversal does the following algorithm (inpseudo-code) describe?
Algorithm traversal (root)
if (root is not null)
traversal(leftSubTree)
process(root)
traversal(rightSubTree)
end if
end traversal
breadth first
preorder
inorder
postorder
0.10000 points
QUESTION 10
What kind of traversal does thefollowing algorithm (inpseudo-code) describe?
Algorithm traversal (root)if (root is not null)
traversal (leftsubtree)
traversal (rightsubtree)
process(root)
end if
end traversal
inorder
breadth first
preorder
postorder
0.10000 points
QUESTION 11
An AVL tree is a search tree in which the heights ofthe subtrees differ by no mor
0
1
3
2
0.10000 points
QUESTION 12
A binary search tree (BST) is a binary tree with the followingproperties:
- All items in the left subtree areless than the root.
- All items in the right subtree are greater than or equal tothe root.
- ________________.
The tree is balanced
Each subtree is complete
Each subtree is balanced
Each subtree itself is a binary search tree
0.10000 points
QUESTION 13
What operation does the following BST algorithm (in pseudo-code)describe?
Algorithm aBSTAlgorithm (root)
if (left subtree empty)
return (root)
else
returnaBSTAlgorithm (left subtree)
end if
end aBSTAlgorithm
find a requested node
inorder traversal
find the largest node
find the smallest node
0.10000 points
QUESTION 14
What operation dos the following BST algorithm (inpseudo-code) describe?
Algorithm aBSTAlgorithm (root)
if (right subtree empty)
return (root)
else
returnaBSTAlgorithm (right subtree)
end if
end aBSTAlgorithm
find the largest node
inorder traversal
find the smallest node
find a requested node
0.10000 points
QUESTION 15
What operation does the following BST algorithm (inpseudo-code) describe?
Algorithm aBSTAlgorithm (root,targetKey)
if (empty tree)
return null
end if
if (targetKey < root)
returnaBSTAlgorithm (left subtree, targetKey)
else if (targetKey >root)
returnaBSTAlgorithm (right subtree, targetKey)
else
return root
end if
end aBSTAlgorithm
find the smallest node
inorder traversal
find the largest node
find a requested node
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang