Primitive and Non-Primitive Data Types :Data can be either primitive data types or Non-Primitive data types. The data structures can contain any of these data types.
Primitive data types are those data types,which are not composed of other data types. Primitive data types are Integer, Real and Character data types.
Non-Primitive data types are those data types,which are composed of primitive data types. Normally these are defined by the users,that is why,these are sometimes called user- defined data types. Examples of non primitive data types in C are arrey , structure, class,union etc.
Pointers :
A special data type pointers has been introduced by some programing languages. The pointer data type enables storage of pointers i.e., addressed of some other data location. Pointers are of great use in some popular and efficient data structures like linked lists , stacks, queues and trees etc.
Abstract Data Type (ADT) :-
A useful tool for specifying the logical properties of a data type is the abstract data type or ADT . Fundamentally a data types is a collection of values and a set of operations on those values. That collection and these operations form a mathematical construct that may be implemented using particular hardware and software data structure.
An ADT is a data type that is organised in such a way that the specification of the values and the specification of the operations on those values are separated from the representation of the values and the implementation of the operations. For example, consider a list of abstract data type. A list is basically a collection of elements which can be ordered or unordered. The primitive operations on a list may include adding new elements , deleting elements, determining number of elements in the list and applying a particular process to each element in the list. Here we can not concerned with how a list is represented and how the above mentioned operations are implemented.
We only need to know what is a list whose elements are given and what can we do with the list. We also can defined an array as Abstract data type, Pointer as Abstract data type and Structure as Abstract data type.
Parts of ADT :
An ADT consists of two parts -
(1) Value Definition
(2) Operator Definition
(1) Value Definition :-
A value definition defines the collection of values for the ADT and consists of two parts -
1. Definition Clause
2. Condition Clause
(2) Operator Definition :-
Each operator is defined as an abstract function with three parts : a header, the optinal precondition and the post condition.
Thank You
Comments
Post a Comment
Hello Friends,