Question: Given this code:

```
#include <iostream>
using namespace std;
int main(){
  typedef struct node{
     int data;
     node* left;
     node* right;
   } nodeptr;
  nodeptr *root, *curr, *temp;
}

```

Does `nodeptr *root` and `nodeptr* root` represent the same thing?

Answer: 
> 
> Are the both codes represents the same thing ?
> 
> 
> 

They almost represent the same thing, except that the first one defines `nodeptr` as a `typedef`ed name.

> 
> Is int\* a and int \*a represents the same thing?
> 
> 
> 

Yes.

> 
> For the First code when i declared: `queue < nodeptr >q` it worked but for the second code when i declared in code: `queue < node >q` it did not worked. why?
> 
> 
> 

`queue<nodeptr> q` is the same as `queue<node*> q`. Hence the comparison is not appropriate.

You should be able to use `queue<node>` if you use C++11. See it working at <http://ideone.com/tkij08>.
For your second Question, I would just say that either you write `int* a` or `int *a`, it is one and the same thing.

```
int* a;
int *a;
int * a;

```

All are same where a is a pointer to of type int, infact `int*a;` is a also same...