0% found this document useful (0 votes)
6 views16 pages

Lec-1 Introduction

Uploaded by

Aamir Rasool
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views16 pages

Lec-1 Introduction

Uploaded by

Aamir Rasool
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 16

Data Structures

Lecture-1:
Introduction
Visit: tshahab.blogspot.com
Books
 Data Structures and Algorithms
By A. V. Aho, J. E. Hopcroft, J. D. Ullman

 Introductions to algorithms by Thomas H.Cormen, Leiserson,


Rivest and Stein.
 Data Structures Using C and C++
By Y. Langsam, M. J. Augenstein, A. M. Tenenbaum

 Schaum's Outline Series, Theory and problems of Data Structures


By Seymour Lipschutz

Some topics will be covered from other books. Material will be


provided for these topics.

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.

 Answers for some problems can be


discussed in class and others will be your
responsibility.

 You should do all exercises by the stipulated


time.

 It is important that you do the homework.


Many (but not all) of the exam questions are
similar to those assigned in the homework.
4 4
Dishonesty, Cheating in Quizzes,
Assignments & Projects
 Copying material in any form (code or otherwise) is
not allowed.
 This will still be cheating even if you try to substitute
or restructure words, structures, paras.
 You can always discuss ways to solve problem with
your colleagues however you should not copy code.
 Penalty can be a zero in that and one other
assignment on to a penalty of an F in the course.

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

 An algorithm is a definite procedure for solving a


problem in finite number of steps

 Algorithm is a well defined computational


procedure that takes some value (s) as input,
and produces some value (s) as output.

 Algorithm is finite number of computational


statements that transform input into the output

11 11
Good Algorithms?

 Run in less time


 Consume less memory

But computational resources (time


complexity) is usually more important

12 12
Complexity
 In examining algorithm efficiency we must
understand the idea of complexity

 Complexity is the consumptions of resources.

 Most important aspect of complexity are


 Space complexity
 Time 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)

 Space complexity is still important in the field of


embedded computing (hand held computer
based equipment like cell phones, palm devices,
etc)

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

 Benchmarking: implement algorithm,


 run with some specific input and measure time taken
 better for comparing performance of processors than for
comparing performance of algorithms
 Big Oh (asymptotic analysis)
 associates n, the problem size,
 with t, the processing time required to solve the
problem
16 16

You might also like