Mena Sargios
Quiz von , erstellt am more than 1 year ago

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

778
0
0
Mena Sargios
Erstellt von Mena Sargios vor mehr als 7 Jahre
Schließen

0. AVL Tree Visualization

Frage 1 von 16

1

An AVL tree is an example of a balanced tree.

Wähle eins der folgenden:

  • WAHR
  • FALSCH

Erklärung

Frage 2 von 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 ?

Wähle eine der folgenden:

  • A) Right

  • B) left

  • C) Left Right

  • D) Rgiht left

Erklärung

Frage 3 von 16

1

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

Wähle eine der folgenden:

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

  • none of the above

Erklärung

Frage 4 von 16

1

What is a "balanced" binary tree?

Wähle eine der folgenden:

  • 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

Erklärung

Frage 5 von 16

1

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

Wähle eine der folgenden:

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

  • none of the above

Erklärung

Frage 6 von 16

1

What is an AVL tree?

Wähle eine der folgenden:

  • 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

Erklärung

Frage 7 von 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?

Wähle eine der folgenden:

  • 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

Erklärung

Frage 8 von 16

1

What makes AVL trees different from Binary Search Trees?

Wähle eine der folgenden:

  • 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

Erklärung

Frage 9 von 16

1

What is an AVL tree visualization?

Wähle eine der folgenden:

  • 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.

Erklärung

Frage 10 von 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.

Wähle eins der folgenden:

  • WAHR
  • FALSCH

Erklärung

Frage 11 von 16

1

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

Wähle eine der folgenden:

  • A. left,left

  • B. left,right

  • C. right,right

  • D. right,left

  • E. All of the above

Erklärung

Frage 12 von 16

1

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

Wähle eine der folgenden:

  • A. logn

  • B. nlogn

  • C. n

  • D. n2

Erklärung

Frage 13 von 16

1

What do AVL trees do?

Wähle eine der folgenden:

  • 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

Erklärung

Frage 14 von 16

1

What is the worst case possible height of AVL tree?

Wähle eine der folgenden:

  • A.n

  • B.n^2

  • C.1.44 log n

  • D.n+2

Erklärung

Frage 15 von 16

1

What is the term for AVL tree balancing?

Wähle eine der folgenden:

  • zig-zag

  • none of the above

Erklärung

Frage 16 von 16

1

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

Wähle eine der folgenden:

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

  • none of the above

Erklärung