/kd-tree-implementation

Implementation of a 2-dimensional kd-Tree data structure in Python.

Primary LanguagePython

kd-Tree-implementation

Implementation of a 2-dimensional kd-Tree data structure in Python.

Execution

  1. Run the main.py.
  2. Uncomment the test cases and run the file to see the results.

kd-Tree Methods

  • tree = KDTree() - creates an instance of a kd-tree from the KDTree class
  • tree.insert((a,b)) - inserts the tuple (a,b), where a and b are real numbers, into the kd-tree
  • tree.visualize() - prints the kd-tree to show its tree structure
  • tree.delete((a,b)) - deletes the node (a,b), where a and b are real numbers, from the kd-tree