| 1234567891011121314151617181920212223242526 |
- // include guard
- #ifndef AVLC_H
- #define AVLC_H
- #include <iostream>
- #include <cstdio>
- #include <string>
- #include "json.hpp"
- #include "BST.h"
- class AVLCommands{
- int *heapArray; // pointer to heap array
- int max_size; // max size of heap array
- int heap_size; // elements in heap
- void swap(int*, int*); // swaps two keys in the heap
- public:
- AVLCommands();
- // required functions from PDF
- void Insert(int key); // inserts a new key into AVL tree
- void Delete(int key); // deletes specified key
- void DeleteMin(); // removes the minimum value key
- // helpful functions
- void printJSONTree(int, int); // prints the heap as a JSON object
- };
- #endif
|