Lec1 (DONE)
Lec1 (DONE)
1
Prof. Ossama Ismail
Data Structures
Lecture 1:
Introduction 1.0
2
Prof. Ossama Ismail
Class Administration
• On –Campus Lectures, Monday 8:30am and at 10:30am
• Instructor:
– Prof. Ossama Ismail
– Email: ossama@aast.edu & Ossama.m.i@gmail.com
• Teaching Assistant
Eng. …
Email:
3
Prof. Ossama Ismail
–
Course Policies
• Roughly weekly written homework due at the start
of class on the due date
• Projects (2 total) due by 10PM on the due date
• you have 4 late days for projects
• Grading
• Mid-term Exam 20%
• Homeworks 10%
• Lab Exam 20%
• Projects 20%
• Final Exam 50%
• Best of these 10%
4
Prof. Ossama Ismail
Read Ahead
• You are expected to read the PPT notes
before the class.
6
Prof. Ossama Ismail
Goals of the Course
• Become familiar with some of the fundamental
data structures in computer science
• Improve ability to solve problems abstractly
• data structures are the building blocks
• Improve ability to analyze your algorithms
• prove correctness
• gauge (and improve) time complexity
7
Prof. Ossama Ismail
Course Overview
• Introduction to many of the basic data structures used in
computer software
• Understand the data structures
• Analyze the algorithms that use them
• Know when to apply them
• Practice design and analysis of data structures.
• Practice using these data structures by writing programs.
• Make the transformation from programmer to computer
scientist
Prof. Ossama Ismail
Course requirements
• Learn a programming language like C/C++/Java is
suitable for this course.
• Practice what you've learnt by writing simple codes.
You can find them very well-known ones everywhere
online. But you must understand them !!!
• Get familiar with the concepts of pointers by learning
C.
9
Prof. Ossama Ismail
Goals
• You will understand
• what the tools are for storing and processing common
data types
• which tools are appropriate for which need
• So that you can
• make good design choices as a developer, project
manager, or system customer
• You will be able to
• Justify your design decisions via formal reasoning
• Communicate ideas about programs clearly and
precisely
11
Prof. Ossama Ismail
Classification of Data Structure
12
Prof. Ossama Ismail
The Need for Data Structures
Data structures organize data
more efficient programs.
More powerful computers more complex
applications.
More complex applications demand more
calculations.
Complex computing tasks are unlike our everyday
experience.
13
Prof. Ossama Ismail
Organizing Data
15
Prof. Ossama Ismail
Select a data structure as follows:
1. Analyze the problem to determine the
resource constraints a solution must
meet.
2. Determine the basic operations that must
be supported. Quantify the resource
constraints for each operation.
3. Select the data structure that best meets
these requirements.
16
Prof. Ossama Ismail
Efficiency
A solution is said to be efficient if it solves the problem
within its resource constraints.
• Space
• Time
• The cost of a solution is the amount of resources that
the solution consumes.
20
Prof. Ossama Ismail
• Algorithm Properties:
• It must be correct.
• It must be composed of a series of concrete steps.
• There can be no ambiguity as to which step will be
performed next.
• It must be composed of a finite number of steps.
• It must terminate.
21
Prof. Ossama Ismail
• Implementation of data structure
• A specific implementation in a specific language
22
Prof. Ossama Ismail
Why So Many Data Structures?
Ideal data structure:
“fast”, “elegant”, memory efficient
Generates tensions:
• time vs. space
• performance vs. elegance
• generality vs. simplicity
• one operation’s performance vs. another’s
23
Prof. Ossama Ismail
Examples
24
Prof. Ossama Ismail
ADT vs Data Structures
Available Data Types
ADT:
Data Items:
Type
Logical Form
Operations
25
Prof. Ossama Ismail
Mathematical Background
• Set concepts and notation.
• Recursion
• Induction Proofs
• Logarithms
• Summations
• Recurrence Relations
26
Prof. Ossama Ismail
What is Program
• A Set of Instructions
• Data Structures + Algorithms
Where,
• Data Structure = A Container stores Data
• Algorithm = Logic + Control
27
Prof. Ossama Ismail
Functions of Data Structures
• Add
• Index
• Key
• Position
• Priority
• Get
• Change
• Delete
31
Prof. Ossama Ismail