34
Introduction to Data Structures and Algorithms Mr. Mubashir Ali Lecturer (Dept. of Software Engineering) [email protected] Lahore Garrison University, Lahore 1 Lecture 01

Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Introduction to Data Structures and Algorithms

Mr. Mubashir AliLecturer (Dept. of Software Engineering)

[email protected] Garrison University, Lahore

1

Lecture 01

Page 2: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Acknowledgement

I would like to take this opportunity to thanks,

Mr. Douglas Wilhelm Harder

(Department of Electrical and Computer Engineering)

University of Waterloo

Waterloo, Ontario, Canada.

for help and providing resources to build this course.

Mubashir Ali - Lecturer (Department of Software Engineering)

2

Page 3: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Outline

• Grading Policy

• Academic Honesty

• Introduction to the Course & Learning Outcomes.

• Semester Research Project

• Improving your Performance

• Home/Lab Work

• Summary

Mubashir Ali - Lecturer (Department of Software Engineering)

3

Page 4: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Mubashir Ali - Lecturer (Department of Software Engineering)

4

Grading Policy

Classification

Assignments & Quizzes 10%

Attendance & Class Participation 5%

Mid-term Exam 20%

Final-term Exam 40%

Research Project 25%

Total 100%

Page 5: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Mubashir Ali - Lecturer (Department of Software Engineering)

5

Academic Honesty

Your work in this class must be your own

If students are found to have collaboratedexcessively or to have cheated (e.g. by copying orsharing answers during an examination), allinvolved will at a minimum receive grades of“0” for the first violation

Further violations will result in failure in the course

Page 6: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Mubashir Ali - Lecturer (Department of Software Engineering)

6

Few Things to Remember

Attendance will be taken with in 5 minutes at thestart of class

Students are allowed to enter into class with in 15minutes at the starting of class

Zero tolerance policy on attendance, discipline ofclass during lectures!

Assignments must be submitted on time, no latesubmissions

In case of copied assignment both parties will begiven zero!

Page 7: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Mubashir Ali - Lecturer (Department of Software Engineering)

7

Few Things to Remember

Research Project is mandatory, A Studentconsidered to be FAIL, If he or she fails to submitthe research project.

Projects, Presentation, Quizzes, Assignments, Classparticipation are very important.

All laptop computers, cell phones, tabletcomputers must be closed during lecture hours.

Page 8: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

1. Course Outline

Abstract data types, complexity analysis, Big Ohnotation, Stacks, linked and array implementations,Recursion and analyzing recursive algorithms, selectionsort, insertion sort, merge sort, quick sort, queue,dequeuer, priority queues, linked and arrayimplementations of queues, linked list and sortedlinked list, searching an unsorted array.

Mubashir Ali - Lecturer (Department of Software Engineering)

8

Page 9: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

1. Course Outline

Binary search for sorted arrays, hashing, openaddressing and chaining, trees and tree traversals,binary search trees, heaps, M-way tress, balancedtrees, graphs, breadth-first and depth-first traversal,topological order, shortest path, adjacency matrix andadjacency list implementations.

Mubashir Ali - Lecturer (Department of Software Engineering)

9

Page 10: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

1.1 Introduction to the Course

In this course, we will look at:– Algorithms for solving problems efficiently– Data structures for efficiently storing, accessing, and

modifying data– Comparative Analysis of same class and different class

algorithms– Efficient Implementations and performance

Improvement of algorithmsWe will see that all data structures have trade-offs:

– There is no ultimate data structure...– The choice depends on our requirements

Mubashir Ali - Lecturer (Department of Software Engineering)

10

Page 11: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

1.2 Learning Outcomes

At the end of the course the students will be able to:

• Acquire the basic knowledge of data structuresalgorithms and understand the concepts of variousdata structures and use them in differentapplications.

• Solve, analyze and evaluate the problems usingdifferent data structures and algorithms.

• Demonstrate& apply independently the variousforms of data structures and algorithms.

Mubashir Ali - Lecturer (Department of Software Engineering)

11

Page 12: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

1.3 Semester Research Project

• A Research paper in form of semester project will besubmitted before final terminal exam.

• Its may be comparative analysis, performanceimprovement, algorithm enhancement in closedenvironment or addressing any relevant problem.

• Semester Project must be submitted individually or 2-member group.

• Submission at TURNITIN (Also used for checkingplagiarism).

Mubashir Ali - Lecturer (Department of Software Engineering)

12

Page 13: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

1.3 Semester Research Project

Semester Project consist of following sections that submitted within deadlines,

– Abstract( Problem Definition, Contribution, Scope)

– Introduction (Importance, Uses)

– Literature Review (Background Studies)

– Methodology (Flow Chart, Proposed Model)

– Experimentation & Results (Environment, Data Set, Graphs, Tables, Charts)

– Conclusion & Future Direction

– References (Mendelay)

Mubashir Ali - Lecturer (Department of Software Engineering)

13

Page 14: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

1.4 Language and Tool

You will be using the C++ language in this course andDev IDE for programming.

Mubashir Ali - Lecturer (Department of Software Engineering)

14

Modified for C++ from http://www.foxtrot.com/

Page 15: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

1.5 Books & Resources

1. Data Structures and Algorithms in C++ by Adam Drozdek

2. Data Structures and Algorithm Analysis in Java by Mark A. Weiss

3. Data Structures and Abstractions with Java by Frank M. Carrano & Timothy M. Henry

4. Data Structures and Algorithm Analysis in C++ by Mark Allen Weiss

5. Java Software Structures: Designing and Using Data Structures by John Lewis and Joseph Chase

Mubashir Ali - Lecturer (Department of Software Engineering)

15

Page 16: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

1.6 Other Resources of Help

1. Web URL in Lectures

2. Lectures Notes

3. Source Codes

4. Online Tutorials

5. The lab instructor

Mubashir Ali - Lecturer (Department of Software Engineering)

16

Page 17: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

2. Improving your Performance

The human brain can retain approximately 5-9 independentitems of information in its short-term memory

George Miller, The Magical Number Seven, Plus or Minus Two:Some Limits on Our Capacity for Processing Information,Psychological Review, Vol.63 pp.81–97, 1956

The introduction of new information causes the brain todiscard an item currently in your short-term memory– For example, consider the 12 words which will appear on the next

sequence of screens

Your goal: at the end, write down all twelve words

Mubashir Ali - Lecturer (Department of Software Engineering)

17

Page 18: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Improving your Performance

Dog

Mubashir Ali - Lecturer (Department of Software Engineering)

18

Page 19: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Improving your Performance

Ultimate

Mubashir Ali - Lecturer (Department of Software Engineering)

19

Page 20: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Improving your Performance

Dinner

Mubashir Ali - Lecturer (Department of Software Engineering)

20

Page 21: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Improving your Performance

Bark

Mubashir Ali - Lecturer (Department of Software Engineering)

21

Page 22: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Improving your Performance

Best Friend

Mubashir Ali - Lecturer (Department of Software Engineering)

22

Page 23: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Improving your Performance

Plane

Mubashir Ali - Lecturer (Department of Software Engineering)

23

Page 24: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Improving your Performance

Sea

Mubashir Ali - Lecturer (Department of Software Engineering)

24

Page 25: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Improving your Performance

Research

Mubashir Ali - Lecturer (Department of Software Engineering)

25

Page 26: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Improving your Performance

Outing

Mubashir Ali - Lecturer (Department of Software Engineering)

26

Page 27: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Improving your Performance

Budget

Mubashir Ali - Lecturer (Department of Software Engineering)

27

Page 28: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Improving your Performance

Thief

Mubashir Ali - Lecturer (Department of Software Engineering)

28

Page 29: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Improving your Performance

Trip

Mubashir Ali - Lecturer (Department of Software Engineering)

29

Page 30: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Improving your Performance

• Now, write down as many of these words as you can,

– Most of you will be able to write down somewhere between7 through 9 of these

– Your mind remember words of your interest

– Create interest in DSA

Mubashir Ali - Lecturer (Department of Software Engineering)

30

Page 31: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Improving your Performance

• To transfer information from your short-term memoryto your long-term memory, that information must beimposed on your mind at least three times.

• You should always try the following:

– Look at the slides before class

– Attend lectures

– Review the lecture during the evening

• Rewrite and summarize the slides in your words

Mubashir Ali - Lecturer (Department of Software Engineering)

31

Page 32: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

3. Home/Lab Work

• Revise and Practice C++ Concepts

– Program Structure

– Bug & Debugging

– Basic Concepts (Variables, Data Types, Operators etc)

– Sequential Processing

– Conditional Processing

– Iterative Processing

– Function Calls

– Pointer and Array Implementations

– Object Oriented Concepts (Classes, Inheritance,Polymorphism, Abstraction, Encapsulation, Templates etc)

Mubashir Ali - Lecturer (Department of Software Engineering)

32

Page 33: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

Summary

Grading Policy

Academic Honesty

Introduction to the Course & Learning Outcomes.

Semester Research Project

Improving your Performance

Home/Lab Work

Summary

Mubashir Ali - Lecturer (Department of Software Engineering)

33

Page 34: Introduction to Data Structures and Algorithms Mr ...€¦ · 1.1 Introduction to the Course In this course, we will look at: –Algorithmsfor solving problems efficiently –Data

References

you will be able to find course resources at

http://www.mubashirali.com/data-structures-algorithms/

– http://www.cplusplus.com/

– https://www.bloodshed.net/dev/devcpp.html

– https://arxiv.org/list/cs.DS/recent

Mubashir Ali - Lecturer (Department of Software Engineering)

34