Lec-1 Introduction
Lec-1 Introduction
Lecture-1:
Introduction
Visit: tshahab.blogspot.com
Books
Data Structures and Algorithms
By A. V. Aho, J. E. Hopcroft, J. D. Ullman
2
Projects/Homeworks
submission
Deadlines are always final
Submission guidelines must be followed.
Submit compressed files (rar,zip).
Name your submission folder in the format
RollNo_Name_HW#
e.g. 123_Umar_HW#3
No grouping is allowed in assignments.
3
Homework Assignments
Will be made very often in the class or lab
with an opportunity for class discussion of
answers.
5
Grading
Assignments, Quizzes, 12
Projects
Midterm Exam 18
Final(Theory) 30
Final(Practical) 20
Total 80
6
What is a Computer Program?
To exactly know, what is data structure?
We must know:
What is a computer program?
Some mysterious
processing Output
Input
7
Example
Data structure for storing data of students:-
Arrays
Linked Lists
Issues
Space needed
Operations efficiency (Time required to complete
operations)
Retrieval
Insertion
Deletion
Frequency of usage of above operations
8
What data structure to use?
Data structures let the input and output be represented in a way
that can be handled efficiently and effectively.
array
Linked list
queue
tree stack
9
What’s the difference
Different types of values
Different structures
No structure – just a collection of values
Linear structure of values – the order matters
Set of key-value pairs
Hierarchical structures
Grid/table
….
Different access disciplines
get, put, remove anywhere
get, put, remove only at the ends, or only at the top, or …
get, put, remove by position, or by value, or by key, or …
….
10 10
Algorithm Review
11 11
Good Algorithms?
12 12
Complexity
In examining algorithm efficiency we must
understand the idea of complexity
13 13
Space Complexity
When memory was expensive we focused on
making programs as space efficient as possible
and developed schemes to make memory appear
larger than it really was (virtual memory and
memory paging schemes)
14 14
Time Complexity
Is the algorithm “fast enough” for my
needs
How much longer will the algorithm take if
I increase the amount of data it must
process
Given a set of algorithms that accomplish
the same thing, which is the right one to
choose
15 15
Algorithm Efficiency
A measure of the amount of resources
consumed in solving a problem of size n
time
space