AVLCommands.h 747 B

1234567891011121314151617181920212223242526
  1. // include guard
  2. #ifndef AVLC_H
  3. #define AVLC_H
  4. #include <iostream>
  5. #include <cstdio>
  6. #include <string>
  7. #include "json.hpp"
  8. #include "BST.h"
  9. class AVLCommands{
  10. int *heapArray; // pointer to heap array
  11. int max_size; // max size of heap array
  12. int heap_size; // elements in heap
  13. void swap(int*, int*); // swaps two keys in the heap
  14. public:
  15. AVLCommands();
  16. // required functions from PDF
  17. void Insert(int key); // inserts a new key into AVL tree
  18. void Delete(int key); // deletes specified key
  19. void DeleteMin(); // removes the minimum value key
  20. // helpful functions
  21. void printJSONTree(int, int); // prints the heap as a JSON object
  22. };
  23. #endif