Typedef is a facility to create new data type name in C. If you are writing code in C++, the equivalent of typedef is the class name, so typedef is superfluous, if legal in syntax at all.

Assuming you are writing in C, you can read up section 6.7 of Kernighan and Richie's "The C Programming Language" which describes all the details, and from which I paraphrase the last paragraph for your information:

Besides purely aesthetic issues, there are two main reasons for using typedefs.
The first is to parametrize a program against portability problems. ...
The second purpose of typedefs is to provide better documentation for a program - a type called Treeptr may be easier to understand than one declared only as a pointer to a complicated structure

this is a code for the root of a tree
why do they add typedef
it makes no sense using it in the building of a data type

and there is no two names after the struct

The typedef defines a new type. It makes a lot of sense, although one could argue that a less confusing choice of names might be a bit better. That is the mindset that leads to naming types with an _t suffix. On the other hand, some organizations explicitly mandate that the struct tag name and the corresponding typedef type name must be identical.