Lecture 2.2
Lecture 2.2
Technology
Data Structures
Abstract Data Types
• What is a character?
– What are the operations that can be performed
on characters?
Some more basic questions
• How an integer is represented in memory?
– How the integer based operations are
performed?
7
Abstract Data Types
Def. a collection of related data
items
together with
an associated
e.g. whole setand
numbers (integers) ofarithmetic
operationsoperators for
addition, subtraction, multiplication and division.
Why "abstract?"
Data, operations, and relations are studied independent of
implementation.
8
Abstract Data Types
Def.Consists of
storage structures (data structures)
to store the data items
and
algorithms for the basic operations.
10
Data Type
ADT:
Data Items:
Type
Logical Form
Operations
11
ADT example
Data Structures, Abstract Data Types,
and Implementations
• ADT consists of
The collection of data items
Basic operation that must be performed on
them
19
Boolean data
Data values: {false, true}
Unicode
00000000010110002
88 =
Signed integer:
Store in a fixed number w of bits using either of complement
representations:
Operations: arithmetic operators for addition,
subtraction, multiplication and division
22
Algorithm Review
• An algorithm is a definite procedure for solving a
problem in finite number of steps
27
Want to achieve platform-independence
11
Running Time of an Algorithm
• Running time is measured in terms of number of
steps/primitive operations performed