Skip to content

Latest commit

 

History

History

README.md

Trees

This directory contains Python implementations of various tree-based data structures and algorithms.

Contents

Binary Search Trees (BST)

  • Binary Search Tree Implementation: A comprehensive implementation of a BST with TreeNode and BinarySearchTree classes, including insertion, deletion, and search.
  • Validate BST (Solution 1): Validates a BST by performing an in-order traversal and checking if the resulting values are sorted.
  • Validate BST (Solution 2): Validates a BST by keeping track of the minimum and maximum allowable values for each node.
  • Trim a BST: Trims a BST so that all node values fall within a specified range $[min, max]$.

Search Algorithms

Heaps

Tree Representations & Traversals