Is there a way to shorten this while condition?
Sure, you could just use a string of valid operators and search it. #include <cstring> // : : const char* ops = “+-*/”; while(strchr(ops, temp->left->oper) || strchr(ops, temp->right->oper)) { // do something } If you are concerned about performance, then maybe table lookups: #include <climits> // : : // Start with a table initialized to … Read more