Top Banner
Introduction to Data Structure www.eshikshak.co.in
10
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction of data structure

Introduction to

Data Structure

www.eshikshak.co.in

Page 2: Introduction of data structure

Algorithm An algorithm is a finite set of instructions

which, when followed, accomplishes a particular task.

Its Characteristics Each instruction should be unique and concise Each instruction should be relative in nature

and should not be repeated infinitely. Repetition of same task(s) should be avoided. The result be available to the user after the

algorithm terminates.

www.eshikshak.co.in

Page 3: Introduction of data structure

Efficiency of Algorithms

O The performance of algorithms can be measured on the scales

O TimeO Space

www.eshikshak.co.in

Page 4: Introduction of data structure

Space ComplexityO The amount of memory space required by

the algorithm during the course of executionO Some of the reasons for space complexity

areO If the program, is to run on mutli-user system, it may be

required to specify the amount of memory to be allocated to the program

O We may be interested to know in advance that whether sufficient memory is available to run the program.

O There may be several possible solutions with different space requirements.

www.eshikshak.co.in

Page 5: Introduction of data structure

Space needed by Program Components

O Instruction Space – Space needed to store the executable version of the program and it is fixed.

O Data Space : It is needed to store all constants, varialbe values

O Environment Space : Space needed to store the information needed to resume the suspended functions.

www.eshikshak.co.in

Page 6: Introduction of data structure

Time ComplexityO The amount of time needed to run to

completion.O Some reasons for studying time

complexityO We may be interested to know in

advance that whether a program will provide satisfactory real time response.

O There must be several possible solutions with different time requirements.

O

www.eshikshak.co.in

Page 7: Introduction of data structure

Data structureO When elements of data are organized together

in terms of some relationships among the elements, the organization is called data structure.

O A data structure is a set of data values along with the relationship between the data values in form of set of operations permitted on them.

O Arrays, records, stacks, lists, graphs are the names of some of some of these basic data structures.

www.eshikshak.co.in

Page 8: Introduction of data structure

A data structure can be

(a) transient i.e. it is created when a program starts and is destroyed when the program ends. Most data structures in main memory are transient, for example, an array of data.

(b) Permanent i.e. it already exists when a program starts and is preserved when the program ends. Most data structures on disk are permanent, for example, a file of data, or a cross-linked data file collection (a database).

www.eshikshak.co.in

Page 9: Introduction of data structure

www.eshikshak.co.in

Data Structure

Linear Non-Linear

- Array- Stack- Queue- Linked

Lists

- Tree- Graph

Page 10: Introduction of data structure

Abstract Data Type (ADT)

O It is a mathematical model with a collections of operations defined on that model.

O The ADT encapsulates a data type can be localized and are not visible to the users of the ADT.

O An implementation of an ADT is a translation into statements of a programming language, of the declaration that defines a variable to be of that ADT, plus a procedure in that language for each operation of the ADT.

www.eshikshak.co.in