Explanation:

- **Binary Space Partitioning** is a technique used for recursively dividing a space into two half-spaces by hyperplanes (lines in 2D, planes in 3D).
-
- It is used in **computer graphics**, **collision detection**, and **ray tracing**.

-

  • Steps:

    • The space is recursively divided by choosing hyperplanes (like splitting a 2D plane into two parts).
    • BSP trees store this hierarchical structure, which can be traversed for efficient querying of the space.
  • Time Complexity:

    • Insertion: O(log n)
    • Querying: O(log n) for spatial queries.