Skip to content

Latest commit

 

History

History
15 lines (9 loc) · 651 Bytes

README.md

File metadata and controls

15 lines (9 loc) · 651 Bytes

Binary and AVL_trees

binary_tree.py contains an implementaiton of a binary tree, at the bottom of the file are some functions that need implementing to turn the binary tree into an AVL_tree

testing.py is what I've been using to run the code and it displays the trees.

I've based the binary tree implementation on this one: https://github.com/laurentluce/python-algorithms/blob/master/algorithms/binary_tree.py

I've extended it to AVL trees using: https://www.geeksforgeeks.org/avl-tree-set-1-insertion/

Instructions: 1)Add parents to the class

2)Extend insert and delete to add/remove parents

3)Implement rotate_right and rotate_left