fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <class T>
  5. class Set
  6. {
  7. public:
  8. Set();
  9. ~Set();
  10. void push(const T&);
  11. bool belongs(const T&) const;
  12. void remove(const T&);
  13. const T& min() const;
  14. const T& max() const;
  15. unsigned int cardinal() const;
  16. void show(std::ostream&) const;
  17.  
  18. friend ostream& operator<<(ostream& os, const Set<T> &c) {
  19. c.show(os);
  20. return os;
  21. }
  22. struct Node
  23. {
  24. Node(const T& v);
  25. T value;
  26. Node* left;
  27. Node* right;
  28. };
  29. private:
  30.  
  31.  
  32.  
  33. Node* root_;
  34. int cardinal_;
  35.  
  36. // This function is the one with errors.
  37. Node & fatherOfNode(const Node & root, const T & key, const bool hook) const;
  38.  
  39. };
  40.  
  41. template <class T>
  42. typename Set<T>::Node & Set<T>::fatherOfNode(const Set<T>::Node & root, const T & key, const bool hook) const {
  43. // Some code
  44. }
  45.  
  46. int main() {
  47.  
  48.  
  49. // your code goes here
  50. return 0;
  51. }
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
Standard output is empty