0% found this document useful (0 votes)
27 views

Intro Data Structure

This document discusses data structures. It defines a data structure as a way of organizing and storing data in a computer so that it can be used efficiently. Different data structures are suited to different applications. It also discusses basic principles of data structures, language support for data structures, data types, abstract data types, and examples of how abstract data types can be implemented with different data structures.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Intro Data Structure

This document discusses data structures. It defines a data structure as a way of organizing and storing data in a computer so that it can be used efficiently. Different data structures are suited to different applications. It also discusses basic principles of data structures, language support for data structures, data types, abstract data types, and examples of how abstract data types can be implemented with different data structures.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Data Structures

Data structure:
In computer science, a data structure is a particular way of storing and organizing
data in a computer so that it can be used efficiently.
Different kinds of data structures are suited to different kinds of applications, and
some are highly specialized to specific tasks. For example, B-trees are
particularly well-suited for implementation of databases, while compiler
implementations usually use hash tables to look up identifiers.

Data structures are used in almost every program or software system. Specific
data structures are essential ingredients of many efficient algorithms, and make
possible the management of huge amounts of data, such as large databases and
internet indexing services. Some formal design methods and programming
languages emphasize data structures, rather than algorithms, as the key
organizing factor in software design.
Basic principles:
Data structures are generally based on the ability of a computer to fetch and
store data at any place in its memory, specified by an address — a bit string that
can be itself stored in memory and manipulated by the program. Thus the record
and array data structures are based on computing the addresses of data items
with arithmetic operations; while the linked data structures are based on storing
addresses of data items within the structure itself. Many data structures use both
principles, sometimes combined in non-trivial ways (as in XOR linking)
The implementation of a data structure usually requires writing a set of
procedures that create and manipulate instances of that structure. The efficiency
of a data structure cannot be analyzed separately from those operations. This
observation motivates the theoretical concept of an abstract data type, a data
structure that is defined indirectly by the operations that may be performed on it,
and the mathematical properties of those operations (including their space and
time cost).
Language support:
Most Assembly languages and some low-level languages, such as BCPL,
generally lack support for data structures. Many high-level programming
languages, and some higher-level assembly languages, such as MASM, on the
other hand, have special syntax or other built-in support for certain data
structures, such as vectors (one-dimensional arrays) in the C language, multi-
dimensional arrays in Pascal, linked lists in Common Lisp, and hash tables in
Java and in Python. Many languages also provide basic facilities such as
references and the definition record data types, that programmer can use to build
arbitrarily complex structures.

Most programming languages feature some sort of library mechanism that allows
data structure implementations to be reused by different programs. Modern
languages usually come with standard libraries that implement the most common
data structures. Examples are the C++ Standard Template Library, the Java
Collections Framework, and Microsoft's .NET Framework.

Spring 2011
Data Structures

Modern languages also generally support modular programming, the separation


between the interface of a library module and its implementation. Some provide
opaque data types that allow clients to hide implementation details. Object-
oriented programming languages, such as C++, Java and .NET Framework use
classes for this purpose.
With the advent of multi-core processors, many known data structures have
concurrent versions that allow multiple computing threads to access the data
structure simultaneously.

DATA TYPE:
Data type of a variable is the set of values that the variable may assume.
Basic Data Types in C:
int, char , float , double
Basic Data Types in PASCAL:
integer, real , char , boolean

ABSTRACT DATA TYPE:


An ADT is a set of elements with a collection of well defined operations.
1) The operations can take operands from not only the instances of the ADT but
other types of operands or instances of other ADTs.
2) Similarly results need not be instances of the ADT.
3) At least one operand or the result is of the ADT type in question.
Object oriented languages such as C++ and Java provide explicit support for
expressing ADTs by means of Classes.

DATA STRUCTURE:
A Data Structure is an implementation of an ADT.That is it is a translation of ADT
into statements of a programming language. It consists of
1) The declarations that define a variable to be of that ADT type.
2) The operations defined on the ADT (using procedures of the programming
language).
An ADT implementation chooses a data structure to represent the ADT.
Each data structure is built up from the basic data types of the underlying
programming language using the available data structuring facilities, such as
arrays, records (structures in C), pointers, files, sets, etc.

Example:
A” Queue” is an abstract data type which can be defined as a sequence of
elements with operations such as ENQUEUE(x,Q),DEQUEUE(Q) .
This can be implemented using data structures such as
1) Array
2) Singly linked list
3) Doubly linked list
4) Circular array

Spring 2011

You might also like