Original code:
#include
#include
#include
class Node { public: Node(int value, Node* left, Node* right) { this->value = value; this->left = left; this->right = right; } int getValue() const { return value; } Node* getLeft() const { return left; } Node* getRight() const { return right; } private: int value; Node* left; Node* right; }; class BinarySearchTree { public: static bool contains(const Node& root, int value) { throw std::logic_error("Waiting to be implemented"); } }; #ifndef RunTests int main() { Node n1(1, NULL, NULL); Node n3(3, NULL, NULL); Node n2(2, &n1, &n3); std::cout << BinarySearchTree::contains(n2, 3); } #endif
Dashboard
Start Trial
Sign In
Home
Product
Features
Use Cases
Customers
ROI Calculator
Integrations
Assessments
Tests
Questions
Pricing
Resources
Book: Evidence-Based Hiring
Blog
Support
Contact Us
Legal
For Jobseekers
© TestDome, 2024.