Back to marketplace

Binary_Search_Tree_Algorithms_Flashcards

No description yet. This curated deck is ready for daily study.

Total cards: 5•Content version: v3•Public deck•Updated: 8/1/2026

Card preview (5)

#1
Front (Question)

How does a binary search tree (BST) work?

Back (Answer)

Each node has at most two children; the left child contains smaller values, the right child contains larger values.

#2
Front (Question)

What is the main advantage of using a binary search tree?

Back (Answer)

It allows efficient searching, insertion, and deletion with average time complexity of O(log n) if balanced.

#3
Front (Question)

What is the difference between searching in a BST and an array?

Back (Answer)

BST uses node comparisons and has average O(log n) complexity; array search is linear (O(n)) unless it’s a binary search on a sorted array.

#4
Front (Question)

What are the steps to insert a value into a binary search tree?

Back (Answer)

Compare the value to the current node, go left if smaller or right if larger, and repeat until an empty position is found.

#5
Front (Question)

What are the steps to remove a node from a binary search tree?

Back (Answer)

Handle three cases: node has no children (remove directly), one child (replace with child), or two children (replace with in-order successor or predecessor).