harsh-dart / HactoberFest2024

5 stars 17 forks source link

Implement Binary Search Tree (BST) in Python #16

Open Mefisto04 opened 1 day ago

Mefisto04 commented 1 day ago

I would like to contribute by adding the code implementation of Binary Search Tree (BST) using Python. The code will include functions for insertion, deletion, search, and traversal (in-order, pre-order, and post-order).

Problem Description:

We need to create a Binary Search Tree (BST) that can perform the following operations:

  1. Insert a node into the BST.
  2. Delete a node from the BST.
  3. Search for a specific value in the BST.
  4. Perform In-order, Pre-order, and Post-order traversal of the BST.

Input:

Constraints:

Output:

Sample Test Case:

Input:

Insert 20
Insert 10
Insert 30
Insert 25
Search 25
Delete 10
InOrder

Output:

Found
20 25 30

Request:

I kindly request to assign this issue to me and add the hacktoberfest label.

Thank you!