Lecture 2.1
Lecture 2.1
Technology
Data Structures
Introduction
Computer
Programming
How to write software with the help of procedural and object oriented
programming?
Data Structures
How to efficiently utilize memory with the help of different data structures?
Algorithm
Analysis
Failure 8224641-1
Success
Syed Faraz Sharfabad Street Gulshan, Faisalabad
Issue Not
Issue
• Any disadvantage of Linear Array (Data
Structure)?
Example
• Improved Data Structure
– Create a dictionary data structure
– Group all those records together that start with
similar NIC (first digit) numbers, and add a
dictionary entry for each distinct digit (0-9)
Dictionary Array
Elements
NIC# Name Address
6584495-9 Muhammad House No 3 Gulshan Bahar Sec 16
Faheem
1748425-5 Naeem Alam A-11 Shams Plaza Block-B
N.Nazimabad
0889679-1 Arslan Akhtar H No 152 Bostang Colony
3419668-1 Zain Ahmed Sharfabad Street Gulshan Karachi
3445864-3 Sumair Farooq Post Office Tayyar, Multan
6395653-4 Ali Affan H.No. 425, Sector F-11/4,
Islamabad
Example
• Another Data Structure
• Maintain pointers with records
• Non NULL pointer indicates presence of
next record
0 6584495-9 Muhammad
Faheem
House No 3 Gulshan Bahar Sec 16
• 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?
20
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.
21
Abstract Data Types
Def.Consists of
storage structures (data structures)
to store the data items
and
algorithms for the basic operations.