radha gogia
Firstly , why is this called a data type ,when we have actual implementation of the abstract data type as a data structure ,then why to use the term data type?
ADT is called data type because in behaviour, it is a data type, As using integer type we create integer variables, similarly using List we create several list variables.
radha gogia
Secondly,I came across through this statement while studying "ADT CAN BE IMPLEMENTED USING DATA TYPE OR DATA STRUCTURE" ,what is the meaning of this line?
This line is about the implementation of ADT, for example if we want to implement real numbers as ADT, we can simply use data type float and proceed with the implementation, or we can use an array(a data structure) of characters which will store our real numbers and a decimal(if present) and then we'll define operations. So in the first case we implemented using data type , while in second using data structure.
radha gogia
I am actually not getting out that are all data structures referred to as a data type because in C we say that a structure is both a data type and a data structure ,so actually how the stuff works?
Yeah, structure in C is both
Structure is a data type : as we can define variables for a particular structure.
Eg if we have:
struct book{
char name[10];
int cost;
};
:
:
book new_book; // see, we defined a variable using book [B]DATA TYPE[/B]
Structure is a data structure as it is a collection of data types.
Well the reply got too long 😁
Hope it helps 😀[/QUOTE][/QUOTE]