DSA 1A-Data STructure
DSA 1A-Data STructure
Algorithms
SIR. HABIB UR RAHMAN
Data Structure
A data structure is a particular way of storing and organizing data in a
computer so that it can be used efficiently.
Data structures determine the way in which information can be stored in
computer and used
Organizing Data
Any organization for a collection of records that can be searched, processed in
any order, or modified.
The choice of data structure and algorithm can make the difference between a
program running in a few seconds or many days.
Efficient Solution
A solution is said to be efficient if it solves the problem within its resource
constraints
◦ Space
◦ Time
Selecting a Data Structure
Select a data structure as follows:
Analyze the problem to determine the resource constraints a solution
must meet.
Determine the basic operations that must be supported. Quantify the
resource constraints for each operation.
Select the data structure that best meets these requirements.
Some Questions to Think about DS
Are all data inserted into the data structure at the beginning?
Can data be deleted?
Are all data processed in some well-defined order or is random access
allowed?
Data Structures
Data Structure
◦ Arrays
◦ Link List
◦ Stacks
◦ Queues
◦ Trees
◦ Graphs
◦ Heaps
◦ Etc.
Evaluation Criteria
Mid term
Final Term
Assignments
Quizzes
Lab Work
Attendance + Project Presentations
Recommended Books
1. Data Structures and Algorithms in C++ by Adam Drozdek
2. Data Structures and Abstractions with Java by Frank M. Carrano &
Timothy M. Henry
3. Data Structures and Algorithm Analysis in C++ by Mark Allen
Weiss
Data Structure Philosophy
Each data structure has costs and benefits.
Rarely is one data structure better than another in all situations.
A data structure requires:
◦ space for each data item it stores,
◦ time to perform each basic operation,
◦ programming effort.
Abstract Data Type
An Abstract Data Type (ADT) is a data type that is organized in such a
way that the specification of the object and the specification of the
operations of the objects is separated from the representation of the
object and the implementation of the operations.
Abstract data type is defined indirectly, only by the operations that may be
performed
ADT is like the black box
Example
Abstract stack data structure could be defined by following operations:
◦ Push
◦ Pop