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

Algorithms Lec 1

Uploaded by

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

Algorithms Lec 1

Uploaded by

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

CS 478: Design and Analysis of Algorithms

Introduction

Fall 2024
Mr. Ahsan Shah

Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi


CS 478: Design and Analysis of Algorithms

About Me

Email: [email protected]
Faculty of Computer Science and Engineering
Office: M-01
• Will be using google class room for communication:
Google Classroom Code for AI: jmdnfst Google

Classroom Code for CS: oca57mu


Office Hours:
• 9:00 AM - 4:00 PM

Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi


CS 478: Design and Analysis of Algorithms

Course TA

• Mr. ____________
• Never hesitate to contact TA or me whenever you have some problem

Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi


CS 478: Design and Analysis of Algorithms

Course Goals
• Upon successful completion of this course, the students will be
able to Know the concepts for design and analysis of
algorithms which form the foundations of theoretical computer
science.
• Upon successful completion of this course, the students will be
able to Design and analyze the advance data structures and
algorithms.
• Upon successful completion of this course, the students will be
able to Apply majority of efficient algorithms to design and
solve most of the today’s problems.

Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi


CS 478: Design and Analysis of Algorithms

Books & Reference Material

• Introduction to Algorithms, 4th Edition, Thomas Cormen,


Charles E. Leiserson, Ronald L. Rivest Clifford Stein, The MIT
Press.

Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi


CS 478: Design and Analysis of Algorithms

Dishonesty, Plagiarism in Quizzes, Assignments

• All individuals involved in any kind of cheating in any exam, quiz, assignment or

project will get 0 weightage.

Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi


CS 478: Design and Analysis of Algorithms

Course Ethics

Projects/Assignments
⚫ Deadlines are always final
⚫ No credit for late submissions
⚫ One student per assignment at maximum
⚫ Three students per project at maximum
⚫ Project Proposal Submission : 8th Week
⚫ Project Presentation : Last week

Quizzes
⚫ Announced
⚫ Unannounced

Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi


CS 478: Design and Analysis of Algorithms

Attendance

• Students are required to attend 100% classes of


courses registered and can not abstain from even
a single class.

• For circumstances beyond their control, students


must apply for leave on prescribed Leave
Application form.

• Minimum attendance requirement for Final


examination will be 80% in any case.

Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi


CS 478: Design and Analysis of Algorithms

Tentative Evaluation Breakdown

Assignments (2) 05
Quizzes (4) 15
Term Project (1) 10
Midterm (1) 30
Final (1) 40

Total 100

Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi


CS 478: Design and Analysis of Algorithms

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
– Cramming is not a good study habit.
So, Avoid it
– Never even think to use mobile phones in the class

Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi


CS 478: Design and Analysis of Algorithms

Course Problems…Cheating

• What is cheating?
–Studying together in groups is encouraged
–Turned-in work must be completely your own.
–Copying someone else’s solution on a HW or exam is cheating
–Both “giver” and “receiver” are equally culpable
• We have to address the issue once the cheating is reported by TAs or me.

Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi


CS 478: Design and Analysis of Algorithms

Course Outline (Tentative)


1. Introduction to Algorithms
2. Asymptotic Notation
3. Time and Space Complexity
4. Master Theorm
5. Divide and Conquer, All sorting Algorithms, Heap Trees
6. Greedy Methods
7. Job Sequencing, Knapsack, Optimal Merge Pattern,
Huffman Encoding, Dijkstra’s method and MST
8. Graph Traversal (DFS, BFS, Connected Components)
9. Dynamic Programming
10. All pair shortest path, Multistage graph, Optimal Binary
Search Tree, 0/1 Knapsack, LCS, Matrix Chain
Multiplication, Sum over Subsets
11. Hashing
12. Problems (P, NP, NP-Hard and NP-Complete)

Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi


CS 478: Design and Analysis of Algorithms

What is an Algorithm?

• The word Algorithm means ” A set of rules to be followed in calculations or other


problem-solving operations ” Or ” A procedure for solving a mathematical problem in a
finite number of steps that frequently by recursive operations “.
• Therefore Algorithm refers to a sequence of finite steps to solve a particular problem.
• Algorithms can be simple and complex depending on what you want to achieve.

Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi


CS 478: Design and Analysis of Algorithms

Types of Algorithms
• Brute Force Algorithm: It is the simplest approach for a problem. A brute force
algorithm is the first approach that comes to finding when we see a problem.
• Recursive Algorithm: A recursive algorithm is based on recursion. In this case, a
problem is broken into several sub-parts and called the same function again and
again.
• Backtracking Algorithm: The backtracking algorithm basically builds the solution by
searching among all possible solutions. Using this algorithm, we keep on building the
solution following criteria. Whenever a solution fails we trace back to the failure point
and build on the next solution and continue this process till we find the solution or all
possible solutions are looked after.
• Searching Algorithm: Searching algorithms are the ones that are used for searching
elements or groups of elements from a particular data structure. They can be of
different types based on their approach or the data structure in which the element
should be found.
• Sorting Algorithm: Sorting is arranging a group of data in a particular manner
according to the requirement. The algorithms which help in performing this function
are called sorting algorithms. Generally sorting algorithms are used to sort groups of
data in an increasing or decreasing manner.
Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi
CS 478: Design and Analysis of Algorithms

Types of Algorithms

• Hashing Algorithm: Hashing algorithms work similarly to the searching algorithm. But they
contain an index with a key ID. In hashing, a key is assigned to specific data.
• Divide and Conquer Algorithm: This algorithm breaks a problem into sub-problems, solves a
single sub-problem and merges the solutions together to get the final solution. It consists of the
following three steps:
• Divide
• Solve
• Combine
• Greedy Algorithm: In this type of algorithm the solution is built part by part. The solution of the
next part is built based on the immediate benefit of the next part. The one solution giving the
most benefit will be chosen as the solution for the next part.
• Dynamic Programming Algorithm: This algorithm uses the concept of using the already found
solution to avoid repetitive calculation of the same part of the problem. It divides the problem into
smaller overlapping subproblems and solves them.
• Randomized Algorithm: In the randomized algorithm we use a random number so it gives
immediate benefit. The random number helps in deciding the expected outcome.

Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi

You might also like