Mena Sargios
Quiz by , created more than 1 year ago

Algorithms and Data Structures | Test 3 Review | CSCI-3110-002 MTSU

768
0
0
Mena Sargios
Created by Mena Sargios over 7 years ago
Close

0. AVL Tree Visualization

Question 1 of 16

1

An AVL tree is an example of a balanced tree.

Select one of the following:

  • True
  • False

Explanation

Question 2 of 16

1

When the Avl is in a left left case which of these steps should you take
to correct the height of the tree ?

Select one of the following:

  • A) Right

  • B) left

  • C) Left Right

  • D) Rgiht left

Explanation

Question 3 of 16

1

Why is a balance condition imporant in binary search trees like AVL?

Select one of the following:

  • It ensures that the depth of the tree is O(logN)

  • none of the above

Explanation

Question 4 of 16

1

What is a "balanced" binary tree?

Select one of the following:

  • A) A tree whose leaves are all on the same depth

  • B) A complete and full tree

  • C) A tree whose left and right subtrees differ by at most 1 in depth

  • D) A binary tree cannot be balanced

Explanation

Question 5 of 16

1

What’s the average case for search? Worst case?

Select one of the following:

  • O(log n); O(log n)

  • none of the above

Explanation

Question 6 of 16

1

What is an AVL tree?

Select one of the following:

  • A) a tree with lots of leaves

  • B) a self balancing binary tree

  • C) there is no such thing

  • D) a tree with the parent being the smallest value

Explanation

Question 7 of 16

1

When inserting into an AVL tree, the first step is to insert a node in its proper place according to BST rules.
After BST insertion however, the tree is not guaranteed to be an AVL tree. What is the next step in the algorithm?

Select one of the following:

  • A. if the new node is a left leaf, rotate left

  • B. update the height and determine the balance of the tree recursively

  • C. if the new node is a right leaf, rotate right

  • D. deconstruct the tree and build it again from scratch

Explanation

Question 8 of 16

1

What makes AVL trees different from Binary Search Trees?

Select one of the following:

  • In an AVL tree every node in the tree, the height of the left and right subtrees can differ by at most one.

  • none of the above

Explanation

Question 9 of 16

1

What is an AVL tree visualization?

Select one of the following:

  • A. an AVL tree is a self-balancing binary search tree.

  • B. an AVL tree is a non-balancing binary search tree.

  • C. an AVL tree is a back-balancing binary search tree.

  • D. an AVL tree is a front-balancing binary search tree.

Explanation

Question 10 of 16

1

An Adelson-Velskii Landis (AVL) tree is a self-balancing Binary Search Tree(BST) that maintains it's height to be O(log N) when having N vertices in the AVL tree.

Select one of the following:

  • True
  • False

Explanation

Question 11 of 16

1

When rotating an AVL tree which of the following are a case where you would need to rotate?

Select one of the following:

  • A. left,left

  • B. left,right

  • C. right,right

  • D. right,left

  • E. All of the above

Explanation

Question 12 of 16

1

In average case, what is the efficiency of insertion of an AVL tree

Select one of the following:

  • A. logn

  • B. nlogn

  • C. n

  • D. n2

Explanation

Question 13 of 16

1

What do AVL trees do?

Select one of the following:

  • They automatically readjust to keep the tree more balanced with a
    lower height. This reduces the worst-case scenario of searching.

  • none of the above

Explanation

Question 14 of 16

1

What is the worst case possible height of AVL tree?

Select one of the following:

  • A.n

  • B.n^2

  • C.1.44 log n

  • D.n+2

Explanation

Question 15 of 16

1

What is the term for AVL tree balancing?

Select one of the following:

  • zig-zag

  • none of the above

Explanation

Question 16 of 16

1

What is the biggest height difference an AVL tree can have without rotating?

Select one of the following:

  • At most the difference can be a height of 1.

  • none of the above

Explanation