Exam 19: Binary Trees
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of C++50 Questions
Exam 3: Input/Output50 Questions
Exam 4: Control Structures I (Selection)50 Questions
Exam 5: Control Structures II (Repetition)50 Questions
Exam 6: User-Defined Functions50 Questions
Exam 7: User-Defined Simple Data Types, Namespaces, and the string Type50 Questions
Exam 8: Arrays and Strings50 Questions
Exam 9: Records (structs)50 Questions
Exam 10: Classes and Data Abstraction50 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, Abstract Classes, and Lists50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Linked Lists50 Questions
Exam 17: Stacks and Queues50 Questions
Exam 18: Searching and Sorting Algorithms50 Questions
Exam 19: Binary Trees50 Questions
Exam 20: Graphs50 Questions
Exam 21: Standard Template Library (STL)50 Questions
Select questions type
1.current = root;
2.while (current is not NULL or stack is nonempty)
if (current is not NULL)
{
visit current node;
push current onto stack;
current = current->lLink;
}
else
{
current = stack.top();
pop stack;
current = current->rLink; //move to the right child
}
Free
(Short Answer)
4.7/5
(39)
Correct Answer:
preorder
In the diagram of a binary tree,an arrow is called a(n)____.
Free
(Multiple Choice)
4.9/5
(37)
Correct Answer:
D
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.
Free
(Short Answer)
4.8/5
(33)
Correct Answer:
preorder
The most common operation performed on a binary tree is a(n)____.
(Multiple Choice)
4.8/5
(28)
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.
(Short Answer)
4.9/5
(41)
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 ____.
(Multiple Choice)
4.8/5
(35)
The three traversal algorithms discussed for binary trees are ____,____,and ____.
(Multiple Choice)
4.9/5
(46)
In a diagram of a binary tree,each node is represented as a(n)____.
(Multiple Choice)
4.8/5
(42)
In a binary search tree,the data in each node is ____ the data in the right child.
(Multiple Choice)
4.9/5
(37)
To destroy a binary tree,for each node,first we destroy its left subtree,then its right subtree,and then the node itself.We must then use the operator ____________________ to deallocate the memory occupied by the node.
(Short Answer)
4.7/5
(39)
The sequence of operations in a postorder traversal is ____.
(Multiple Choice)
4.9/5
(47)
In a binary tree,the level of the children of the root node is ____.
(Multiple Choice)
4.8/5
(39)
The item search,insertion,and deletion operations all require the binary tree to be traversed.
(True/False)
4.7/5
(43)
When a class object is passed by value,the ____________________ constructor copies the value of the actual parameters into the formal parameters.
(Short Answer)
4.7/5
(37)
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.
(Short Answer)
4.8/5
(32)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)