Considering many problems where we use recursive functions such as traversing through tree structures.. it it better to use threads or recursive function itself.. WHich is faster.. and what are the advantages and disadvantages...
For example
Code:
//Recursive function to display nodes in binary tree...
displaynode(node *temp)
{
cout<<temp->val;
if(temp->left!=NULL)
displaynode(temp->left);
if(temp->right!=NULL)
displaynode(temp->right);
}
Is the above better or instead creating a new thread every time instead of calling the function better...