Binary Search Tree

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

1/21

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:08 PM on 10/8/25
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

22 Terms

1
New cards

y.key < x.key < z.key

BST Property:
(left < root < right)

2
New cards
3
New cards

two

every node has at most __ children

4
New cards
  1. key

  2. left

  3. right

  4. parent

node structure includes:
1.
2.
3.
4.

5
New cards

min key

leftmost node

6
New cards

max key

rightmost node

7
New cards

recursively search left

if k < root.key, …

8
New cards

recursively search right

if k > root.key, …

9
New cards

successor

node with a key just larger (next inorder traversal)

10
New cards

successor case 1

min in right subtree

11
New cards

successor case 2

first ancestor “on the right”

12
New cards

predecessor

node with key just smaller

13
New cards

O(h)

space complexity for BST is __ time

14
New cards

z with key k

Insertion is node ___

(insertion position is where k is expected to be found)

15
New cards

x

deletion is node __

16
New cards

deletion case 1

x is a leaf (just remove x)

17
New cards

deletion case 2

x has one child (splice/connect parent to child)

18
New cards

deletion case 3

x has 2 children (swap x with successor, then delete)

19
New cards

O(log n)

O(n)

Best Case: ____

Worst Case:___

20
New cards
  1. root

  2. left

  3. right

preorder traversal is
1.
2.
3.

21
New cards
  1. left

  2. root

  3. right

inorder traversal is
1.
2.
3.

22
New cards
  1. left

  2. right

  3. root

postorder traversal is
1.
2.
3.

Explore top flashcards