basics

7
1 Basic Terminologies Basic Terminologies Data Structures Data Structures

Upload: rajendranjrf

Post on 13-Aug-2015

60 views

Category:

Education


1 download

TRANSCRIPT

Page 1: Basics

1

Basic Terminologies Basic Terminologies

Data StructuresData Structures

Page 2: Basics

2

Abstract Data Type (ADT)Abstract Data Type (ADT)• Mathematical description of an object with set of Mathematical description of an object with set of

operations on the object. Useful building block.operations on the object. Useful building block. AlgorithmAlgorithm

• A high level, language independent, description A high level, language independent, description of a step-by-step processof a step-by-step process

Data structureData structure• A specific family of algorithms for implementing A specific family of algorithms for implementing

an abstract data type.an abstract data type. Implementation of data structureImplementation of data structure

• A specific implementation in a specific languageA specific implementation in a specific language

TerminologyTerminology

Page 3: Basics

3

TerminologyTerminology DataData

Data refers to value or set of values. Data refers to value or set of values.

e.g.Marks obtained by the students.e.g.Marks obtained by the students. Data typeData type

data type is a classification identifying one of various data type is a classification identifying one of various typestypes

of data, such as floating-point, integer, or Boolean, that of data, such as floating-point, integer, or Boolean, that

determines the possible values for that type; the determines the possible values for that type; the operations operations

that can be done on values of that type; and the way that can be done on values of that type; and the way valuesvalues

of that type can be storedof that type can be stored

Page 4: Basics

4

TerminologyTerminology

Primitive data type:Primitive data type:

These are basic data types that are provided by theThese are basic data types that are provided by the

programming language with built-in support. These dataprogramming language with built-in support. These data

types are native to the language. This data type istypes are native to the language. This data type is

supported by machine directlysupported by machine directly

VariableVariable

Variable is a symbolic name given to some known or Variable is a symbolic name given to some known or

unknown quantity or information, for the purpose of unknown quantity or information, for the purpose of

allowing the name to be used independently of the allowing the name to be used independently of the

information it represents.information it represents.

Page 5: Basics

5

RecordRecord

Collection of related data items is known as record. The Collection of related data items is known as record. The

elements of records are usually Called fields or members elements of records are usually Called fields or members ..

Records are distinguished from arrays by the fact that Records are distinguished from arrays by the fact that

their number of fields is typically fixed, each field has a their number of fields is typically fixed, each field has a

name, and that each field may have a different type.name, and that each field may have a different type. ProgramProgram

A sequence of instructions that a computer can A sequence of instructions that a computer can

interpret and execute.interpret and execute.

TerminologyTerminology

Page 6: Basics

6

AA stack is an stack is an abstract data type abstract data type supporting push, pop supporting push, pop and isEmpty operationsand isEmpty operations

A stack A stack data structuredata structure could use an array, a linked list, could use an array, a linked list, or anything that can hold dataor anything that can hold data

One stack One stack implementationimplementation is java.util.Stack; another is is java.util.Stack; another is java.util.LinkedListjava.util.LinkedList

Terminology examplesTerminology examples

Page 7: Basics

7

AbstractAbstract PseudocodePseudocode AlgorithmAlgorithm

• A sequence of high-level, A sequence of high-level, language independent language independent operations, which may operations, which may act upon an abstracted act upon an abstracted view of data.view of data.

Abstract Data Type (ADT)Abstract Data Type (ADT)

• A mathematical A mathematical description of an object description of an object and the set of operations and the set of operations on the object.on the object.

AbstractAbstract PseudocodePseudocode AlgorithmAlgorithm

• A sequence of high-level, A sequence of high-level, language independent language independent operations, which may operations, which may act upon an abstracted act upon an abstracted view of data.view of data.

Abstract Data Type (ADT)Abstract Data Type (ADT)

• A mathematical A mathematical description of an object description of an object and the set of operations and the set of operations on the object.on the object.

ConceptsConcepts vs. vs. MechanismsMechanisms