×
In order to succeed, we must first believe that we can.

# Note for Data Structure using C - DS By seethal babu

• Data Structure using C - DS
• Note
• 29 Views
Seethal Babu
0 User(s)

#### Text from page-2

15 MEA Engineering College, Perinthalmanna 1. Storage representation of user data:User data should be stored in a such a way that computer can understand it. 2. Retrieval of stored data The data stored in a computer should be retrieve in such a way that user can understand it. 3. Transformation of user data Various operations which require to be perform on user data, so that it can transform from one form to another A data structure D is a triplet D=(d,f,a) Where d-Domain Domain is the range of values that a data made up. This domain is also term as data object. f- functions This is the set of operations which may be applied to the element of data object aAxioms this is the set of rules with which different operations belongs to f actually can be implemented Classification of Data Structure Data structure can be classified into linear and nonlinear data structure In case of linear data structure all the elements form a sequence and maintain a linear fashion. In case of nonlinear data structure elements are distributed over a plane, ie follow a nonlinear fashion. Arrays It is a collection of data of same data types stored in consecutive memory location that is referred by a common name Department of Computer Science & Engineering

#### Text from page-3

16 MEA Engineering College, Perinthalmanna Linked List It is a collection of data of same data type ,but the data items need not be stored in consecutive memory locations Stack A stack is Last in First Out(LIFO) data structure, here insertion and deletion takes place at one end called stack top. Here insertion is known as PUSH operation and deletion is known as POP operation Queues A queue is a First in First Out (FIFO) in which insertion takes place at real end and deletion takes place at front end. Insertion is known as enqueue operation and deletion is known as dequeue operation. Trees Trees are used to represent data that has some hierarchical relationship among data elements Department of Computer Science & Engineering

#### Text from page-4

17 MEA Engineering College, Perinthalmanna Graphs A graph is used to represent data that has relationship between pair of elements, not necessarily hierarchical All trees are graphs, but all graphs are not trees Tables In table , data is arranged in no.of rows and columns Sets A set is a abstract data type that can store certain values without any particular order and without any repeatation. Data types Data type is a term which refers to kind of data that may appear in computation. A data type is a classification for identifying one of the various type of data such as real numbers, integers, characters, Booleans etc Data types takes the possible values, the operation on that type, the way the value of that types are stored. Built-in Data types Data types which are built in with the programming language is called built-in data type/fundamental data type. Eg:- the fundamental data type in C are int, float, char, double Data type Number of bytes Range of values char 1 byte -27 to 27-1 int 2 byte -215 to 215 -1 Department of Computer Science & Engineering

#### Text from page-5

18 MEA Engineering College, Perinthalmanna unsigned int 2 byte 0 to 216-1 signed int 2 byte -215 to 215 -1 short int 1 byte -27 to 27-1 long int 4 bytes -231 to 231 -1 float 4 byte 3.4 e -38 double 8 byte 1.7 e -308 long double 10 bytes 3.4 e -4932 to 3.4e +38 to 1.7e +308 to 1.1e+4932 Fundamental data type in Fortran Language:integer, logical, character, complex, double precision, single precision Fundamental data type in Pascal Language:real, character, boolean, array, record, file Fundamental data type in Java Language:int, float, long, byte,etc Scalar Data type A scalar data type is a single unit of data A scalar data type is a single valued data type that can be used for individual variable, constant etc. A scalar data type is atomic:-it is not made up of other variable components Hold a single value  Have no internal components The range of values depends on hardware architecture Eg:- character, number, Boolean etc Primitive Data type In computer science primitive data type referred to either the following concepts 1. Basic type:- it is the data type provided by programming language as a built in block Most languages allow more complicated composite type to be recursively constructed starting from basic type. 2. Built-in type:- is a data type for which the programming language provides built-in support  In most programming languages, all basic data types are built-in.  In addition, many languages also provide a set of composite data types Department of Computer Science & Engineering