Floor and Ceil in BST
📖 Scenario: You are working with a phone book application that stores contacts in a Binary Search Tree (BST) by their phone numbers. You want to find the closest existing phone number that is less than or equal to a given number (floor), and the closest existing phone number that is greater than or equal to a given number (ceil).
🎯 Goal: Build functions to find the floor and ceil values for a given number in a BST of phone numbers.
📋 What You'll Learn
Create a BST with given phone numbers
Add a variable for the target phone number to search floor and ceil for
Write functions to find floor and ceil values in the BST
Print the floor and ceil values for the target number
💡 Why This Matters
🌍 Real World
Finding floor and ceil values in BSTs is useful in phone book lookups, database indexing, and range queries where you want closest matches.
💼 Career
Understanding BST operations and floor/ceil logic is important for software engineers working with search algorithms, databases, and performance optimization.
Progress0 / 4 steps