Professional Documents
Culture Documents
Introduction
Instructor
Email: zahid.halim@giki.edu.pk
Webpage: https://www.minrg.org/zahid
Office: G05
Telephone Extension: 2263
Office Hours:
Wednesday/Thursday 9:00 AM - 4:00 PM
Course TA
• Mr. Aadam
Some Rules
• There is only one rule that will make the rest of the rules
– Raise your hand before asking any question and then WAIT for the
permission
– Never ever Miss a class
– Never ever “sleep” in the class
– Always communicate in the official communication language
– Never even think about using mobile during the class
Books
Introduction to Algorithms
Thomas H. Cormen et al
[Code : C]
Attendance
• Students are required to attend 100% classes of courses
registered and cannot abstain from even a single class.
Quizzes
• Announced
• Unannounced
Assignments (8) 15
Quizzes (8) 10
Term Project (2 phases) 15
Midterm (1) 20
Final (1) 40
Total 100
Course Execution
• Three lectures of one hour every week
• Course website: http://cms.giki.edu.pk
See schedule
Course Outline
• In this course you will learn
– Introduction
– Algorithm Analysis
– Abstract Data Types (ADTs)
– Lists, Stacks, and Queues
– Trees
– Hashing
– Queues
– Sorting
– Graph Algorithms
– Algorithm Design Techniques
Motivation!
Marie Curie
Some mysterious
processing
Input Output
array
Linked list
queue
tree
stack
Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi
Lecture 01: Introduction CS221 Data Structures & Algo.
Some mysterious
processing
Input Output
Data structures+Algorithms=Programs
Definition
• Data may be organized in different ways
– Must be rich enough to mirror the actual relationships of the data in the real world
sample
Arrays
1 Ali
2 Salam
3 Usman
4 Danial
Liner Arrays
5 Saeed
6 Zaka
Array
Ali
Salam A B C
Usman
Danial
Saeed Y
Zaka X
Ali Y
Salam X
Usman Y
Danial X
Saeed Y
X
Arrays
Sale
Item 1 2 8 85
Item 2 5 8 5
Item 4 4 8 5
Item 5 5 5 5
Arrays
Customer Salesperson
1 Jamal Tony
2 Sana Tony
3 Saeed Nadia
4 Farooq Owais
5 Salman Owais
6 Danial Nadia
Link List
Jamal 1
Sana 1
Saeed 2
Farooq 3
Salman 3 Salman 3
Trees
Employee
Trees
(2x+y)(a-7b)3
+ ^
* y - 3
2 x a *
7 b
Stacks
2132
123
123
123
123
IN
123
123
OUT
546
45
543
2544
Queue
2132
123
123
123
IN
123
123
OUT
3
2544
33
• Design Issue:
– select and design appropriate data types.
(This is the real essence of OOP.)
• Sorting
• Merging