Skip to content

BST and AVL trees implemented in Python with the option of drawing them

Notifications You must be signed in to change notification settings

LJaremek/BST-and-AVL-trees

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BST and AVL trees implemented in Python with the option of drawing them.

AVL tree is a self-balancing Binary Search Tree (BST) where the difference between heights of left and right subtrees cannot be more than one for all nodes. The above tree is AVL because differences between heights of left and right subtrees for every node is less than or equal to 1. (~www.geeksforgeeks.org)

BSTree:

image image

AVLTree:

image image

Deleting

image image

Another functions:

  • my_tree.insert(element)
  • my_tree.find(element)
  • my_tree.top()
  • my_tree.height()
  • my_tree.balance() <- only in AVL
  • list(my_tree)

About

BST and AVL trees implemented in Python with the option of drawing them

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages