BST Search Operation
📖 Scenario: You are building a simple phone book app that stores contacts in a Binary Search Tree (BST). Each contact has a unique phone number. You want to find if a contact exists by searching the BST.
🎯 Goal: Build a TypeScript program that creates a BST with given phone numbers, then searches for a specific phone number in the BST.
📋 What You'll Learn
Create a BST node class with
value, left, and right propertiesInsert given phone numbers into the BST in the given order
Create a function to search for a phone number in the BST
Print
true if the phone number is found, otherwise false💡 Why This Matters
🌍 Real World
Binary Search Trees are used in phone books, contact lists, and databases to quickly find information by key.
💼 Career
Understanding BST search is important for software engineers working with data storage, search engines, and performance optimization.
Progress0 / 4 steps