Contains the source code from the course work throughout my undergraduate Computer Engineering degree at Brigham Young University. There is a mixture of Go, Python, C, C++, Java, VHDL, Verilog, Matlab, Bash, Assembly, etc..
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RedBlackNodeInterface.h 987B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //YOU MAY NOT MODIFY THIS DOCUMENT
  2. #pragma once
  3. #include <string>
  4. using namespace std;
  5. class RedBlackNodeInterface {
  6. public:
  7. RedBlackNodeInterface() {}
  8. virtual ~RedBlackNodeInterface() {}
  9. /*
  10. * Returns the word that is stored in this node
  11. *
  12. * @return the word that is stored in this node.
  13. */
  14. virtual string getWord() = 0;
  15. /*
  16. * Returns the color of the node. A red node should return 0
  17. * and a black node should return 1.
  18. *
  19. * @return the color of the node
  20. */
  21. virtual int getColor() = 0;
  22. /*
  23. * Returns the left child of this node or null if it doesn't have one.
  24. *
  25. * @return the left child of this node or null if it doesn't have one.
  26. */
  27. virtual RedBlackNodeInterface * getLeftChild() = 0;
  28. /*
  29. * Returns the right child of this node or null if it doesn't have one.
  30. *
  31. * @return the right child of this node or null if it doesn't have one.
  32. */
  33. virtual RedBlackNodeInterface * getRightChild() = 0;
  34. };