Which is faster post increment or pre increment ? and in
which cases should u use either - to increase speed?

Answer Posted / mms zubeir

The above answer seems to be correct but for normal cases
also the behavior is as explained, it is not only for
overloaded case.

A little deeper, since a temporary object is introduced to
swap older and newer values, extra copying is required
which swallow its own CPU time. So the post increment
operator is a bit slower.

But this difference is feeble.

Is This Answer Correct ?    16 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the advantages of inheritance.

677


What is destructor give example?

608


Which is not an object oriented programming language?

544


What is a null tree?

632


Why multiple inheritance is not possible?

605






What is abstraction and encapsulation?

577


What is difference between multiple inheritance and multilevel inheritance?

604


#include #include #include #include void insert(struct btreenode **, int); void inorder(struct btreenode *); struct btreenode { struct btreenode *leftchild; struct btreenode *rightchild; int data; }; main() { struct btreenode *bt; bt=(struct btreenode *)NULL; int req,i=1,num; clrscr(); printf("Enter number of nodes"); scanf("%d",&req); while(i<=req) { printf("Enter element"); scanf("%d",&num); insert(&bt,num); i++; } inorder(bt); } void insert(struct btreenode **sr, int num) { if(*sr==NULL) { *sr=(struct btreenode *)malloc (sizeof(struct btreenode)); (*sr)->leftchild=(struct btreenode *)NULL; (*sr)->rightchild=(struct btreenode *)NULL; (*sr)->data=num; return; } else { if(num < (*sr)->data) insert(&(*sr)->leftchild,num); else insert(&(*sr)->rightchild,num); } return; } void inorder(struct btreenode *sr) { if(sr!=(struct btreenode *)NULL) { inorder(sr->leftchild); printf("\n %d",sr->data); inorder(sr->rightchild); } else return; } please Modify the given program and add two methods for post order and pre order traversals.

3257


What is a superclass in oop?

672


Which language is not a true object oriented programming language?

646


Which method cannot be overridden?

584


What is abstraction in oops?

592


What is basic concept of oop?

702


What are the components of marker interface?

607


i got a backdoor offer in process global,Bangalore..Can i work with it?

2330