Home > Back-end >  Understand the problem about the data structure and abstraction data type?
Understand the problem about the data structure and abstraction data type?

Time:12-08

(1) why before the official start of the data structure of the code is written to define the storage structure of data structure?
Such as typedef struct
{Selemtype * base;
Selemtype * top;
Int stacksize;
} SqStack;
How to understand this? (troubled me for a long time) is to define a similar sqlist BiTree, this data structure to define abstract data types: why not? At that time felt defined BiTree or as a data type to use again, (2) what is the relationship data structure and abstraction data structure, both contain each other? YanWeiMin data structure of the third chapter beginning and stack and queue is a data structure, then say it's important to abstract data types, more meng, and (3) to create a stack, how this function returns the address of the stack, is when defining storage structure and define a pointer, set the type and function as the pointer? (the definition of the book only more confused is this pointer in the linked list storage structure definition from time to tome, is this why?)
(4) remit total: feel the beginning storage structure of the definition of SqStack were used as the data type, for example, has a problem I understand, I want to put together a pile of data is the data structure (relationship), then every data element is the abstract data types, they are the struct type, composed of several basic types, so think typedef struct should define an abstract data type, so the use of, don't know where is wrong, now head is very chaotic, bosses, please explain in detail, feel this problem confused can't write code, thank you very much!!!!!! (beginner data structure, directions.in)
Problem is a little bit more, there was not much logic, and also don't know how to describe, please forgive me!!!!!

CodePudding user response:

 
Typedef struct
{
Selemtype * base;
Selemtype * top;
Int stacksize;
} SqStack;

SqStack * pSqStack=NULL;


 
Struct
{
Selemtype * base;
Selemtype * top;
Int stacksize;
} SqStack;

Struct SqStack * pSqStack=NULL;


Typedef is useful

CodePudding user response:

Typedef names, suggested the original poster on the web search typedef as well as its usage,

If there is any discrepancy in the data structure and structure, suggest to write their own code test, theory with practice, with the theory of practice to guide
  • Related