IntermediateYear 2 undergraduate

Binary Search Tree Implementation and Analysis

Implement insertion, deletion, traversal, and height calculations, then analyze behavior across balanced and unbalanced inputs.

Requirements

  • Create a binary search tree class with a clearly defined node structure.
  • Implement insert, search, delete, and height operations.
  • Support inorder, preorder, and postorder traversal outputs.
  • Document expected time complexity for each operation.
  • Include unit tests for empty trees, duplicate values, and deletion edge cases.

Deliverables

Source code repository or compressed project folder.
A two-page implementation note with complexity analysis.
Test report showing expected and actual outputs.

Assessment focus

1

Correctness and edge-case handling.

2

Clarity of implementation and naming.

3

Quality of complexity analysis.

4

Completeness of tests.