Exam 22: Binary Trees, Avl Trees, and Priority Queues

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

When a new item is added to an AVL tree

(Multiple Choice)
4.8/5
(27)

An AVL tree is

(Multiple Choice)
4.9/5
(42)

Assuming a Node class class Node { int element; Node left,right; Node(int el,Node left,Node right){ element = el; this.left = left; this.right = right; } } Write a method int depth(Node tree)that returns the length of the longest path that begins at the node tree and ends at any leaf of the binary tree.

(Essay)
4.7/5
(41)

A binary tree with just one node has height

(Multiple Choice)
4.8/5
(45)

A binary tree stores items that have a natural order in such a way that at each node X,all items stored in the left subtree of X are less than the item stored at X,and all items stored in the right subtree are greater than the item stored at X.Such a binary tree is called

(Multiple Choice)
4.8/5
(43)

A binary tree is a collection of nodes in which

(Multiple Choice)
4.7/5
(33)

Binary trees have been used

(Multiple Choice)
4.9/5
(29)

Let X be a node in a binary tree.Any node on the path from X to a leaf is called

(Multiple Choice)
4.8/5
(43)

Consider the operation of deleting the root of a binary search tree.If the root has two children,then

(Multiple Choice)
4.8/5
(40)

A complete binary tree with N nodes may be stored in an array A of length N by storing the root at A[0],and then storing in successive array locations the nodes of the tree in increasing order of the level of nodes.If nodes in the same level are stored in left to right order,then the node stored at A[k] will be a leaf if and only if

(Multiple Choice)
4.8/5
(41)

The predecessor of a node in a binary tree is called its

(Multiple Choice)
4.9/5
(34)

A complete binary tree with N nodes has depth approximately equal to

(Multiple Choice)
4.9/5
(38)

To add a new element X to a binary search tree:

(Multiple Choice)
4.8/5
(33)

A binary tree with height 1 must have

(Multiple Choice)
4.8/5
(33)

A node in a binary tree that has no children is called

(Multiple Choice)
4.9/5
(30)

A binary tree traversal method that visits the root first,and then recursively traverses the left and right subtrees is called

(Multiple Choice)
4.7/5
(41)

To find the minimum node in a binary search tree

(Multiple Choice)
4.8/5
(38)

A ternary tree is like a binary tree,except each node may have up to three successors.Write a TNode class that can be used to represent a ternary tree.Define a notion of preorder and postorder traversal for ternary trees,and write methods void postorder(TNode tree)and void preorder(TNode tree)that implements your notion of those traversals.

(Essay)
5.0/5
(50)

Let X be a node in a binary tree.The collection of all descendants of X

(Multiple Choice)
4.8/5
(30)

Traversing a binary search tree in inorder

(Multiple Choice)
4.9/5
(37)
Showing 21 - 40 of 45
close modal

Filters

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