Presentation is loading. Please wait.

Presentation is loading. Please wait.

Code: BCA302 Data Structures with C Prof.(Dr.) Monalisa Banerjee By.

Similar presentations


Presentation on theme: "Code: BCA302 Data Structures with C Prof.(Dr.) Monalisa Banerjee By."— Presentation transcript:

1 Code: BCA302 Data Structures with C Prof.(Dr.) Monalisa Banerjee By

2 Basic concepts of data representation: abstract and system defined types, primitive data structures

3 Data Type Data Type is a term which refers to the kinds of data that variables may hold in any programming language. Eg. In ‘C’ - int, float & char Data classification – a) Abstract Data Type (ADT) & b) System Defined Data Type (SDT)

4 Abstract Data Type ADT - a term which refers to the basic mathematical concept that defines mathematical concept that defines the data type at logical level. the data type at logical level. Abstraction is the structuring of a Abstraction is the structuring of a nebulous problem into well defined nebulous problem into well defined entities by defining their data & entities by defining their data & operations which are coupled with operations which are coupled with each other. each other.

5 Abstract Data Type With abstraction a well defined entity can be created which can be properly handled & these entities define the data structure of a set of items. With abstraction a well defined entity can be created which can be properly handled & these entities define the data structure of a set of items. Definition – An ADT is defined by Definition – An ADT is defined by i) Set of values i) Set of values ii) Operations on these values ii) Operations on these values

6 Abstract Data Type Examples – a) Integers a) Integers i) Values: …, -2, -1, 0, 1, 2, … i) Values: …, -2, -1, 0, 1, 2, … ii) Operations: +, -, %, <, … ii) Operations: +, -, %, <, … b) Stack b) Stack i) Values: set of elements of same type i) Values: set of elements of same type ii) Operations: Push, Pop ii) Operations: Push, Pop

7 System Defined Data Type SDT - a mapping which specifies how every object of ADT is to be represented every object of ADT is to be represented in the environment where it is going to in the environment where it is going to be implemented. be implemented. This requires that every function of ADT This requires that every function of ADT must be written using the functions of must be written using the functions of implementing data type. implementing data type.

8 Data Structure Data structure is a way of organizing data that specifies: i) A set of data elements or a data object ii) A set of operations which may legally be applied to elements of this data object Example – A data object “integers” along with a description of how arithmetic operations +, -, /, etc can be applied to it constitutes a data structure definition

9 Data Structure Data structure can be classified by many ways: 1) Primitive & Non-Primitive Primitive data structure defines a set of primitive elements which do not involve any other elements as its subparts. Primitive data structure defines a set of primitive elements which do not involve any other elements as its subparts. Example - data structure defined for integers, characters etc.

10 Data Structure Non-primitive data structure defines a set of derived elements. Non-primitive data structure defines a set of derived elements. Example – In ‘C’ a ‘struct’ data structure can consist of a set of elements which may be of different data types.

11 Data Structure 2) Linear & Non-linear Linear data structure defines such a set of operations which do not create hierarchical structures among the elements of its data object. Linear data structure defines such a set of operations which do not create hierarchical structures among the elements of its data object. Example – array, single linked list etc.

12 Data Structure Non-linear or hierarchical data structure defines such a set of operations which create an hierarchical structure among the elements of its data object. Non-linear or hierarchical data structure defines such a set of operations which create an hierarchical structure among the elements of its data object. Example – Binary tree.


Download ppt "Code: BCA302 Data Structures with C Prof.(Dr.) Monalisa Banerjee By."

Similar presentations


Ads by Google