What Does This Function Do 1 (37.93 KiB) Viewed 39 times
Can you briefly describe what the function below does in plain English class Node { public: int data; Node* next; }; int func (Node* node, int number) { if (node) { if (node->data > 0) return func (node->next, number) node->data; else if (node->data < 0) return func (node->next, number) + node->data; else return func (node->next, number + node->data) + number; } } return 0;
Register for solutions, replies, and use board search function. Answer Happy Forum is an archive of questions covering all technical subjects across the Internet.