DS Lecture 01 - Introduction PDF
DS Lecture 01 - Introduction PDF
Data Structures
Introduction
Dr. Abdul Waheed Khan
&
Shehreyar Rashid
Shehreyar.rashid@nu.edu.pk
Lecture No. 1
FAST, National University of Computer and Emerging Sciences, Islamabad
Lecture 1: Introduction
Some Rules
– Raise your hand before asking any question and then
WAIT for the permission
– Never ever miss a class
• No retakes (except for Final Exam*)
– Never ever “sleep” in the class
• You might miss a quiz
– Never use mobile phone in the class
Dishonesty, Plagiarism
Dishonesty, Plagiarism
You can fool some of the people all of the time, and
all of the people some of the time, but you can not
fool all of the people all of the time.
Abraham Lincoln,
16th president of US (1809 - 1865)
Attendance Policy
• Student arriving after the attendance will be
marked “late” . No excuse to students arriving
immediately after the attendance.
• Two late arrivals will be treated as absent.
• Students are not allowed to switch sections.
About you?
• You are here because?
General Overview
Introduction to
Computer Science
Computer
Programming
How to write software with the help of procedural and object oriented
programming?
Data Structures
How to efficiently utilize resources with the help of different data structures?
Algorithm Analysis
Course objectives
• In simple words, you will learn how to write
efficent programs.
9
FAST, National University of Computer and Emerging Sciences, Islamabad
Lecture 1: Introduction
Course Contents
• Introduction
• Simple Data Types and Abstract Data Types
• Background: Templates and Algorithm Analysis
• Array
• Searching techniques
• Sorting techniques Mid term
• Linked Lists
• Queue
• Stack
• Trees: Definitions and terminology
• Tree:
• BST
• AVL Trees
• Heap SECOND SESSION
• Graphs
• B+ Trees
• Hashing
Motivational Example
• A cellular service company provides contracts to its 10
million users
• Due to new security enforcements, the company wants
to prevent issuing of multiple contracts to users
Example
New NIC# Name Address
Contract 6584495-9 Muhammad Faheem House No 3 Gulshan Bahar Sec 16
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
Searching
3445864-3 Sumair Farooq Post Office Tayyar, Multan
6395653-4 Ali Affan H.No. 425, Sector F-11/4, Islamabad
8224641-1 Syed Faraz Sharfabad Street Gulshan, Faisalabad
Failure Success
Example
0 2
3 3 4
6 0 5
Example
• Another possibility
• Maintain pointers with structures ( or records)
• Non NULL pointer indicates presence of next
record
3 0889679-1
3419668-1
Arslan Akhtar
Zain Ahmed
H No 152 Bostang Colony
Sharfabad Street Gulshan Karachi
Dictionary
FAST, National University of Computer and Emerging Sciences, Islamabad
Lecture 1: Introduction
Books
• Data Structures Using C++ (By D. S. Malik)