COP3530 - Balanced Trees

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

We are given the following Splay Tree: 5 / \ 3 11 / 1 What will be the root->data after we insert for 0 in the splay tree? Enter exactly one value, e.g. 11

0

Consider the following B tree which has the attributes N=3 and L=2. Its height is 2 (Level 0, 1). What is the level order traversal of this tree using the standard approach(left to right by levels), after inserting 17 and 3 in this tree? 10 | 20 1 | 6 15 24 | 31 N = maximum children a node can have L = maximum keys a node can have

10, 3, 20, 1, 6, 15, 17, 24, 31

Insert the following keys into an empty AVL Tree and then perform a standard (left to right by levels) level order traversal: 2, 3, 4, 1, 6, 5, 0 Note: Enter the level order traversal of elements with each key separated by a space, example: 5 4 3 ...

3 1 5 0 2 4 6

What node is at an imbalance in this tree? 5-4-9-1-13-2

4

A B+ tree has N=4 and L=4. It's height is 3 (Level 0, 1, 2). What is the maximum number of unique keys that it can hold? (Assumption: We have inserted unique keys into this tree) N = maximum children a node can have L = maximum keys a node can have

64

A B tree has N=4 and L=4. It's height is 3 (Level 0, 1, 2). What is the maximum number of keys that it can hold? (Assumption: We have inserted unique keys into this tree) N = maximum children a node can have L = maximum keys a node can have

79

Consider the following binary search tree. 12 4 7 This tree has a [ ______ ] imbalance. This type of imbalance requires a [ ______ ] rotation.

Left-Right Left-Right

Consider the following tree. 34 14 42 6 10 Is this a valid AVL tree?

No

Consider the following tree. 34(RED) 12(RED) 85(BLACK) 5(BLACK) 19(BLACK) 64(RED) 99(RED) Is this tree a valid red-black tree?

No

Consider the following tree: 4 5 8 1 Is this a valid AVL tree?

No

What is the computational complexity of left rotating a binary search tree at a given node in the worst case?

O(1)

Consider the following tree. 34(BLACK) 12(RED) 85(BLACK) 5(BLACK) 19(BLACK) 64(RED) 99(RED) Is this tree a valid red-black tree?

Yes

Consider the following tree: D A M F Z Is this a valid AVL tree?

Yes


Kaugnay na mga set ng pag-aaral

RN Concept-Based Assessment Level 2 Online Practice B

View Set

AH3 CHAPTER 14, 25,26,27,28,29 (12,28,29,30,31,32)

View Set

Chapter 9-11 Discrete Math Final Study Guide

View Set

Chapter 21: Numerical Differentiation

View Set

Introduction to Environmental Health Final

View Set

CompTia A+ Core 2 (220-1002) yesss

View Set

4-Stroke Cycle Engine Theory Terms Ch 5

View Set