Sie sind auf Seite 1von 3

What is Data Structure?

A Data Structure is a specialized format for organizing and storing data in memory. General data structure types include array, file, record, table, tree, graph and so on. An algorithm is a concise specification of a method for solving a problem. A data structure can be viewed as consisting of a set of algorithms for performing operations on the data it stores. Data Structure is a way of storing data in a computer so that it can be used efficiently. A logical or mathematical model of a particular organization of data is called data structure. A memory play a vital role in c because all variable you declare are at first stored in the memory. Some memory allocation is done at compile time and some at runtime. Memory which is allocated and de-allocated during the execution of the program is known as dynamic memory. Memory spans and shrinks as per application requirement and this is one of major advantage of pointer. A memory can be categories in following segments Text Segment Data Segment Free Space Stack Segment

Data Segment in sub-categories in two parts Static Segment Heap Segment The Static Segment hold the global variables and the Heap Segment hold the dynamic variable. Dynamic memory allocation is done by using malloc() funtion in C.

Why Data Structure?

Data Structure Operations


Following are the data structure operations 1. Traversing: accessing each record exactly once. 2. Searching: Finding the location of the record with a given key value or finding the location of all records which fulfill a certain condition. 3. Inserting: Adding a new record into the data structure 4. Deleting: Deleting record from the data structure 5. Sorting: Arranging the records in some logical order. 6. Merging: Combining the records in two different sorted lists into one sorted list.

Types of Data Structures


Linear Data Structure: Linear data structure is linear if element is adjacent to each other. It has exactly two neighbors elements to which it is connected as its previous and next member. Example of Linear Data Structure Array Linked List Stack Queue Non- Linear Data Structure Non-Linear data structure is that if one element can be connected to more than two adjacent element then it is known as non-linear data structure. Example of Linear Data Structure:

Tree s Graph

Areas in which data structures are applied extensively.


1. 2. 3. 4. 5. 6. 7. 8. Compiler Design, Operating System, Database Management System, Statistical analysis package, Numerical Analysis, Graphics, Artificial Intelligence, Simulation

Das könnte Ihnen auch gefallen