In the domain of data structures, Binary Search Trees (BSTs) play a fundamental role in facilitating efficient search, insertion, and…