Algorithm

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Data Structures (1404711)

Course Presentation
by
Dr. Adel A. El-Zoghabi

Professor of Computer Science & Information Technology


Department of Information Technology
Institute of Graduate Studies & Research
Alexandria University

email: [email protected]
Copyright © Prof. Dr. Adel El-Zoghabi 2009-2023

Course Outline
Prerequisite: (Officially None, but technically any programming experience is recommended)
Schedule:
Lectures: Monday 09:00 - 11:00, Starting 3/10/2022
Office Hours: Saturday 08:00 - 09:00, Starting 17/10/2022

Topics:
Basic Concepts of Data Structures (Part 1)
Dynamic Memory Allocations (Part 2)
Some Common Data Structures (Part 3)
Binary Trees and Recursion (Part 4)
Complexity Analysis of Algorithms (Part 5)

Grading Policy:
Mid-Term Exam (30%): Week 8
Course Project (20%): Assigned Week 9, Due Week 12
Final Written Exam (50%): University Schedule

Text Book:
Problem Solving in Data Structures & Algorithms using Python, 1st Edition, Hemant Jain,
CreateSpace Independent Publishing Platform, 2016

Copyright © Prof. Dr. Adel El-Zoghabi 2009-2023









Part # 1

• Basic Concepts of Data Structures


1. Introduction,
2. What is Data Structures?
3. Objectives of this Course,
4. Handling Problems,
5. Abstraction of Real Problems,
6. Abstract Data Types,
7. Programming with Python,
8. Basic Python Data Structures

Copyright © Prof. Dr. Adel El-Zoghabi 2009-2023


Introduction

• The study of data structures, a


fundamental component of IT
education, serves as the foundation
upon which many other fields are built,
• Some knowledge of data structures is a
must for students who wish to do work
in design, implementation, testing, or
maintenance of software

Copyright © Prof. Dr. Adel El-Zoghabi 2009-2023

What is Data Structures?


• Data structures in simple wording are
containers that organize and group data
together in a specific manner,
• When one write a program to solve certain
problem, he/she should primarily think on
how to deal with the data involved and how
to store or structure that data in memory,
• The way one structure and store data can
ultimately have an impact on what kinds of
things he can do with it and how efficiently
he can do various operations
5

Copyright © Prof. Dr. Adel El-Zoghabi 2009-2023


Objectives of this Course

• In this course, data structures are


presented in the object-oriented setting
in accordance with the current design
and implementation paradigm,
• The Python language is widespread in
research & industry, and is also useful
and natural in introducing data
structures

Copyright © Prof. Dr. Adel El-Zoghabi 2009-2023


Handling Problems

• The first thing one is confronted in


writing programs is the problem,
• You are confronted with real problems
and your goal is to provide a program
for the problem,
• Real problems are complicated by
nature, and one can start by separating
necessary from unnecessary details

Copyright © Prof. Dr. Adel El-Zoghabi 2009-2023


Handling Problems

• In other words, one can try to obtain


his own abstract view, or model, of the
problem, a process called abstraction,
see the next slide,
• The model focuses only on problem
related stuff and we should try to define
properties of the problem, including:
• the data which are affected,
• the operations which are identified by the problem

Copyright © Prof. Dr. Adel El-Zoghabi 2009-2023


Abstraction of Real Problems

Problem

Abstraction

Model

Copyright © Prof. Dr. Adel El-Zoghabi 2009-2023


Abstraction of Real Problems

• Consider the automation and the


administration of employees example,
• We should know what information is
needed by the administration? what
tasks should be allowed?
• Employees can be characterized by:
• name, date of birth, social number, room number,
etc., these are called data for the employees model

10

Copyright © Prof. Dr. Adel El-Zoghabi 2009-2023


Abstraction of Real Problems

• There must be some operations, for


example, an operation to create a new
employee once a new person enters the
institution, (Constructor)
• Consequently, you have to identify the
operations that should be performed on
an abstract employee and to decide how
allowing access to the employees' data
only with associated operations

11

Copyright © Prof. Dr. Adel El-Zoghabi 2009-2023


Abstract Data Type

• Thus, with abstraction you create a


well-defined entities that define the data
structure of a set of items,
• The data structure can only be accessed
with defined operations called interface,
• An entity with the properties and the
operations is called an Abstract Data
Type (ADT), see the next slide

12

Copyright © Prof. Dr. Adel El-Zoghabi 2009-2023


Abstract Data Type

ADT

Data Items

Operations
Interface

13

Copyright © Prof. Dr. Adel El-Zoghabi 2009-2023


Abstract Data Type

• An ADT is usually characterized by the


following properties:
– it exports a type,
– it exports a set of operations,
– a subset of operations is called an interface, and
– operations of the interface are the one and only
access mechanism to the type's data structure
• An object-oriented language such as
(Python) has a direct link to ADT by
implementing them as classes
14

Copyright © Prof. Dr. Adel El-Zoghabi 2009-2023


Programming with Python

• With the help from the course Teaching


Assistants (TAs), if needed, you should
install a Python version ( latest version
recommended), that is compatible with
your operating system,
• Optionally, a Python IDE is
recommended, there are many available
for free, the course TAs can guide you in
selecting a suitable one
15

Copyright © Prof. Dr. Adel El-Zoghabi 2009-2023


Basic Python Data Structures

• As a first step in the Python language,


your are asked to search the Internet for
tutorials (example: Tutorial) and try to
identify, distinguish and use the
following 4 basic structures :
– collections,
– lists,
– arrays, and
– strings

16

Copyright © Prof. Dr. Adel El-Zoghabi 2009-2023

You might also like