0. AVL Tree Visualization

Descripción

Algorithms and Data Structures | Test 3 Review | CSCI-3110-002 MTSU
Mena Sargios
Test por Mena Sargios, actualizado hace más de 1 año
Mena Sargios
Creado por Mena Sargios hace más de 7 años
778
0

Resumen del Recurso

Pregunta 1

Pregunta
An AVL tree is an example of a balanced tree.
Respuesta
  • True
  • False

Pregunta 2

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

Pregunta 3

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

Pregunta 4

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

Pregunta 5

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

Pregunta 6

Pregunta
What is an AVL tree?
Respuesta
  • 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

Pregunta 7

Pregunta
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?
Respuesta
  • 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

Pregunta 8

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

Pregunta 9

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

Pregunta 10

Pregunta
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.
Respuesta
  • True
  • False

Pregunta 11

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

Pregunta 12

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

Pregunta 13

Pregunta
What do AVL trees do?
Respuesta
  • 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

Pregunta 14

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

Pregunta 15

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

Pregunta 16

Pregunta
What is the biggest height difference an AVL tree can have without rotating?
Respuesta
  • At most the difference can be a height of 1.
  • none of the above
Mostrar resumen completo Ocultar resumen completo

Similar

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
1. Trees Splay Trees
Mena Sargios
14. Graph Shrtest Path
Mena Sargios
10. Hashing Collision
Mena Sargios