BST Property and Why It Matters
📖 Scenario: Imagine you are organizing a library's book collection. Each book has a unique ID number. You want to store these books so you can quickly find any book by its ID. A Binary Search Tree (BST) helps you do this by keeping books in order.
🎯 Goal: You will build a simple Binary Search Tree (BST) with a few book IDs. Then, you will check if the tree follows the BST property: for every node, all book IDs in the left subtree are smaller, and all in the right subtree are larger. Finally, you will print the tree's in-order traversal to see the sorted order of book IDs.
📋 What You'll Learn
Create a BST node structure with integer book ID
Insert given book IDs into the BST following BST rules
Write a function to check if the tree satisfies the BST property
Print the in-order traversal of the BST
💡 Why This Matters
🌍 Real World
BSTs are used in databases and file systems to organize data for fast searching, insertion, and deletion.
💼 Career
Understanding BSTs is essential for software engineers working with data storage, search algorithms, and system design.
Progress0 / 4 steps