Binary Search Trees

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/13

flashcard set

Earn XP

Description and Tags

These flashcards cover key concepts related to Binary Search Trees (BSTs), their operations, and important characteristics as discussed in the lecture.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

14 Terms

1
New cards

What is a Binary Search Tree (BST)?

A binary tree in symmetric order where each node's key is larger than all keys in its left subtree and smaller than all keys in its right subtree.

2
New cards

What operations can be supported by a Symbol Table in BSTs?

Ordered operations like insert, delete, get, floor, ceiling, rank, and select.

3
New cards

How is a node represented in a BST in Java?

A node is composed of a key, a value, references to left and right subtrees, and may include a count of nodes in its subtree.

4
New cards

What is the time complexity for search operations in an unsorted array?

O(n) for worst-case scenarios.

5
New cards

What does the term 'height of a tree' refer to?

The maximum depth among all its nodes.

6
New cards

What do the terms 'floor' and 'ceiling' refer to in the context of BSTs?

Floor is the largest key in the BST that is less than or equal to a given key, while ceiling is the smallest key that is greater than or equal to the given key.

7
New cards

What happens when inserting keys into a BST in a random order regarding expected height?

The expected height of the resulting BST is approximately ~ log(n) where n is the number of keys inserted.

8
New cards

What is the Hibbard deletion in a BST?

A method for deleting a node in a BST where you search for the node containing the key and handle cases based on its children.

9
New cards

What is the purpose of storing subtree counts in BST nodes?

To efficiently compute the rank of a key and facilitate select operations.

10
New cards

How is 'rank' defined in the context of a BST?

Rank is defined as the count of keys that are less than a given key.

11
New cards

What characteristics of applications make them suitable for using BSTs?

Dynamic data insertions, updates, deletions, and operations like finding max/min or rank.

12
New cards

What is the worst-case performance for search and insert operations in a BST?

O(n) when the tree is unbalanced.

13
New cards

What is an important feature of inorder traversal in a BST?

It yields the keys in ascending order.

14
New cards

What does a 'successful search' in a BST entail?

Starting at the root, navigate left for lesser keys and right for greater keys until the key is found.