0. AVL Tree Visualization

Beschreibung

Algorithms and Data Structures | Test 3 Review | CSCI-3110-002 MTSU
Mena Sargios
Quiz von Mena Sargios, aktualisiert more than 1 year ago
Mena Sargios
Erstellt von Mena Sargios vor etwa 8 Jahre
783
0

Zusammenfassung der Ressource

Frage 1

Frage
An AVL tree is an example of a balanced tree.
Antworten
  • True
  • False

Frage 2

Frage
When the Avl is in a left left case which of these steps should you take to correct the height of the tree ?
Antworten
  • A) Right
  • B) left
  • C) Left Right
  • D) Rgiht left

Frage 3

Frage
Why is a balance condition imporant in binary search trees like AVL?
Antworten
  • It ensures that the depth of the tree is O(logN)
  • none of the above

Frage 4

Frage
What is a "balanced" binary tree?
Antworten
  • 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

Frage 5

Frage
What’s the average case for search? Worst case?
Antworten
  • O(log n); O(log n)
  • none of the above

Frage 6

Frage
What is an AVL tree?
Antworten
  • 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

Frage 7

Frage
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?
Antworten
  • 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

Frage 8

Frage
What makes AVL trees different from Binary Search Trees?
Antworten
  • 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

Frage 9

Frage
What is an AVL tree visualization?
Antworten
  • 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.

Frage 10

Frage
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.
Antworten
  • True
  • False

Frage 11

Frage
When rotating an AVL tree which of the following are a case where you would need to rotate?
Antworten
  • A. left,left
  • B. left,right
  • C. right,right
  • D. right,left
  • E. All of the above

Frage 12

Frage
In average case, what is the efficiency of insertion of an AVL tree
Antworten
  • A. logn
  • B. nlogn
  • C. n
  • D. n2

Frage 13

Frage
What do AVL trees do?
Antworten
  • 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

Frage 14

Frage
What is the worst case possible height of AVL tree?
Antworten
  • A.n
  • B.n^2
  • C.1.44 log n
  • D.n+2

Frage 15

Frage
What is the term for AVL tree balancing?
Antworten
  • zig-zag
  • none of the above

Frage 16

Frage
What is the biggest height difference an AVL tree can have without rotating?
Antworten
  • At most the difference can be a height of 1.
  • none of the above
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

How well do you know GoConqr?
Sarah Egan
2. Red Black Tree
Mena Sargios
12. Graph Traversal
Mena Sargios
5. B-Tree
Mena Sargios
7. Algorithm Growth Rate
Mena Sargios
3. 2-3 Tree
Mena Sargios
16. Greedy Algorithm (Huffman code)
Mena Sargios
4. 2-3-4 Tree
Mena Sargios
10. Hashing Collision
Mena Sargios
1. Trees Splay Trees
Mena Sargios
14. Graph Shrtest Path
Mena Sargios