Exam 19: Binary Trees

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

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:
Verified

preorder

In the diagram of a binary tree,an arrow is called a(n)____.

Free
(Multiple Choice)
4.9/5
(37)
Correct Answer:
Verified

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:
Verified

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)

All binary tree traversals start at the left-most child node.

(True/False)
4.8/5
(37)

Duplicates are allowed in a binary search tree.

(True/False)
4.8/5
(34)

The three traversal algorithms discussed for binary trees are ____,____,and ____.

(Multiple Choice)
4.9/5
(46)

A binary tree is also a(n)____.

(Multiple Choice)
4.9/5
(30)

In a diagram of a binary tree,each node is represented as a(n)____.

(Multiple Choice)
4.8/5
(42)

Every node in a binary tree has ____ pointers.

(Multiple Choice)
4.8/5
(37)

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)

A binary tree has a special node called the ____ node.

(Multiple Choice)
4.8/5
(33)

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
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)