Course File - Cse - Daa 2022-23 Venkat
Course File - Cse - Daa 2022-23 Venkat
COURSE FILE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Programme UG
Branch CSE
Section A,B&C
R.Venkateshwarlu
CSE
Verified by :
Approved by:
HOD-CSE
Course File –Contents
S. No. Title
1 Syllabus Prescribed by University
2 Programme Educational Objectives (PEOs)
3 Programme Outcomes (POs)
UNIT I:
Introduction: Algorithm, Performance Analysis-Space complexity, Time complexity, Asymptotic Notations-
Big oh notation, Omega notation, Theta notation and Little oh notation.
Divide and conquer: General method, applications-Binary search, Quick sort, Merge sort, Strassen’s matrix
multiplication.
UNIT II:
Disjoint Sets: Disjoint set operations, union and find algorithms
Backtracking: General method, applications, n-queen’s problem, sum of subsets problem, graph coloring
UNIT III:
Dynamic Programming: General method, applications- Optimal binary search trees, 0/1 knapsack problem, All
pairs shortest path problem, Traveling sales person problem, Reliability design.
UNIT IV:
Greedy method: General method, applications-Job sequencing with deadlines, knapsack problem, Minimum
cost spanning trees, Single source shortest path problem.
UNIT V:
Branch and Bound: General method, applications - Travelling sales person problem, 0/1 knapsack problem -
LC Branch and Bound solution, FIFO Branch and Bound solution.
NP-Hard and NP-Complete problems: Basic concepts, non deterministic algorithms, NP - Hard and NP-
Complete classes, Cook’s theorem.
TEXT BOOKS:
1. Fundamentals of Computer Algorithms, Ellis Horowitz, SatrajSahni and Rajasekharan, University Press.
REFERENCES:
1. Design and Analysis of algorithms, Aho, Ullman and Hopcroft, Pearson education.
2. Introduction to Algorithms, second edition, T. H. Cormen, C.E. Leiserson, R. L. Rivest, and C. Stein, PHI
Pvt. Ltd./ Pearson Education.
3. Algorithm Design: Foundations, Analysis and Internet Examples, M.T. Goodrich and R. Tamassia, John
Wiley and sons
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PEO1- To provide the learners with fundamental knowledge of applied mathematics, applied sciences
and basic engineering subjects to analyze and solve the problems in Computer Science and
Engineering and its allied fields.
PEO2 - To provide learners with a concrete knowledge in the Core areas like Programming languages,
Computer Organization & Architecture, Operating Systems, Networking, Database Management
Systems, Information & Network Security, Data Mining, etc. and with cutting edge technologies.
PEO3 –To nurture the learners with breadth subjects knowledge and competence in the areas of ES,
VLSI, cloud computing , BigData, Android, Multimedia, IM, Management Science, ENS etc. by
understanding the value of efficient design and development of solutions with multidisciplinary
approach catering to the real-time requirements
PEO4 –To inculcate the learners with advanced subjects knowledge, professional practice,
entrepreneurial skills, teamwork, leadership, project management, personal and professional growth
with ethics and character in developing effective communication, interpersonal and multidisciplinary
skills.
PEO5 –To prepare the learners for higher education, employability, innovative CSE program specific
areas of global technological appliances, research, and service attitude by providing advanced methods
of teaching and learning with effective communication & lifelong learning skills and by executing
MOUs with renowned industries and premier institutes.
.DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAM OUTCOMES
PO2. Problem analysis: Identify, formulate, research literature, and analyze complex engineering
problems reaching substantiated conclusions using first principles of mathematics, natural sciences,
and engineering sciences.
PO3. Design/development of solutions: Design solutions for complex engineering problems and
design system components or processes that meet the specified needs with appropriate consideration
for the public health and safety, and the cultural, societal, and environmental considerations.
PO4. Conduct investigations of complex problems: Use research-based knowledge and research
methods including design of experiments, analysis and interpretation of data, and synthesis of the
information to provide valid conclusions.
PO5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities with an
understanding of the limitations.
PO6. The engineer and society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the
professional engineering practice.
PO7. Environment and sustainability: Understand the impact of the professional engineering
solutions in societal and environmental contexts, and demonstrate the knowledge of, and need for
sustainable development.
PO8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and
norms of the engineering practice.
PO9. Individual and team work: Function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings.
PO12. Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.
PSOs - CSE
PSO1: Graduates will demonstrate the knowledge in allied areas of Computer Science & Engineering.
PSO2: The learners will be able to gain desired knowledge for the Competitive Environment.
Course Outcomes:
Upon completion of this course, the student will be able to:
CO1:Analyze algorithms and estimate their best-case, worst-case and average-case behavior in terms
of time and space complexity.
CO2:Design appropriate algorithm for solving problems using Divide and Conquer, Backtracking.
CO3:Identify the suitable data structures and algorithm designmethods impact the performance of an
algorithm using dynamic programming.
CO4:Apply algorithm design principles to derive solutions for real life problems using greedy method.
CO5:Design deterministic and non-deterministic algorithms for tractable and intractable problems and
classify them as P Class, NP Class, NP-Hard, NP-complete problems
.
Subj P P P P
Ye Se Subject ect CO P P P P P P P P P P O O S S
ar m Name Cod PO O O O O O O O O O O 1 1 O O
e 1 2 3 4 5 6 7 8 9 10 1 2 1 2
CO1 2 3 2 2 1 - - - - 2 2 2 2 3
CO2
Design 2 3 1 2 1 - - - - 2 2 2 2 3
and
Analysis CO3
III II ---- 2 2 2 2 1 - - - - 2 2 2 2 3
of
Algorith CO4
ms 2 3 2 2 2 - - - - 2 2 2 2 2
CO5
2 3 2 2 2 - - - - 2 2 2 2 2
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
LESSON PLAN
CHALK AND
12 1 Quick Sort Quick Sort 1
TALK
Strassen's Matrix Strassen's Matrix CHALK AND
13 1 1
Multiplication Multiplication TALK
CHALK AND
15 2 Disjoint set operations Disjoint set operations 1
TALK
CHALK AND
16 2 union algorithms union algorithms 1
TALK
CHALK AND
17 2 find algorithms find algorithms 1
TALK
CHALK AND
18 2 Collapsing rule Collapsing rule 1
TALK
Weighted union CHALK AND
19 2 Weighted union algorithm 1
algorithm TALK
CHALK AND
20 2 Examples Examples 1
TALK
CHALK AND
21 2 Backtracking General Method 1
TALK
CHALK AND
22 2 The n-queen problem The n-queen problem 1
TALK
CHALK AND
23 2 Examples Examples 1
TALK
CHALK AND
24 2 The 8-queen problem The 8-queen problem 1
TALK
State space tree for GROUP
25 2 State space tree 1
queens problem DISCUSSION
CHALK AND
26 2 sum of subsets sum of subsets 1
TALK
CHALK AND
27 2 Examples Examples 1
TALK
CHALK AND
28 2 graph coloring graph coloring 1
TALK
CHALK AND
29 2 Hamiltonian cycles Hamiltonian cycles 1
TALK
CHALK AND
30 2 Assignment-2 & Test-2
TALK
CHALK AND
31 3 Dynamic Programming General Method 1
TALK
Chained matrix Chained matrix CHALK AND
32 3 1
multiplication multiplication TALK
All pairs shortest path All pairs shortest path CHALK AND
33 3 1
problem problem TALK
Assignment Questions
Q. Bloom’s CO
No Questions Taxonom s
. y Levels
Define algorithm. Explain performance analysis of algorithm with an CO
Knowledg
1 1
example. e
Explain binary search algorithm with an example. Knowledg CO
2
e 1
Write the algorithms for the following CO
3 Create 2
i). UNIONii) FINDiii) WEIGHTED UNION.
Explain Graph Colouring with an example. Knowledg CO
4
e 2
Draw the optimal binary search tree for Let n = 4, and (a1, a2, a3, a4) = CO
5 (do, if, read, while) Let P (1: 4) = (3, 3, 1, 1) and Q (0: 4) = (2, 3, 1, 1, Create 2
1)
Describe a travelling salesperson problem. Find a minimum cost tour for CO
the following graph using dynamic programming. Cost of the edges are 3
given by matrix shown in figure
Knowledg
6
e
Q.
Question Description
No.
a) Explain about Asymptotic Notations. (CO1-Level2)
1 b) Describe the working principle of divide and conquer method. (CO2-Level2)
Draw all possible binary search trees for the identifier set (a1,a2,a3,a4)=(do, if, while) and find
4
cost for each binary search tree. (CO3 – Level6)
III B. Tech I Sem (CSM)
DESIGN ANALYSIS OF ALGORITHMS
I MID EXAMINATIONS – NOV 2023
Objective Exam
Name: _______________________________ Hall Ticket No.
______________________
Answer All Questions. All Questions Carry Equal Marks. Time: 20 Min. Marks:10.
I Choose the correct alternative:
3. If ‘d’ is the degree of a graph, then the possible number of color for coloring the graph are
[ ]
2
A) d-1 B) d+1 C) 2d D) d
5. _____________ is a sorting algorithm that uses the divide and conquer strategy. [ ]
A) Heap B) Bubble C) Quick D) Insertion
8. The live node whose children are currently being generated is called ______ [ ]
A) A-node B) D-node C) E-node D)I-node
10. Which of the following data structure used in Depth first search algorithm? [ ]
A) Stack B) Queue C) Linked list D)None
II Fill in the Blanks
11. The function………………………………… iff there exist positive constants c and n0 such
that f(n)≤c*g(n) for all n,n≥n0.
12. A problem with N inputs will have some constraints any subsets that satisfy these constraints
are called a______________
17. Two queens are lie on the same diagonal if and only if __________
SCHEME OF EVALUATION
MID-I
Example 0.5
1b) Define divide and conquer, algorithm 2
Example 0.5
2 Definition, algorithm for Strassen’s matrix 3
multiplication
Example 2
3a) Definition and algorithm for Graph Coloring 2
Example 0.5
3b) Union and Find Algorithms 2
Example 0.5
4 Draw all possible binary search trees for the 5
identifier set (a1,a2,a3,a4)=(do, if, while) and
find cost for each binary search tree
III B. Tech. (COMPUTER SCIENCE ENGINEERING)
II Semester 2021 - 2022
DESIGN ANALYSIS OF ALGORITHMS
II MID EXAMINATIONS – JULY 2022
Level in Bloom's
Course Outcomes: After completion of the course, the student will be
COs Taxonomy
able to
Analyze algorithms and estimate their best-case, worst-case and
CO 1: average-case behavior in terms of time and space complexity. K4: Analyze
Q.
Question Description
No.
Explain All pairs shortest path problem.(CO3-Level2)
1
Consider the following instances of knapsack problem n=3, m=20, profits (p1, p2, p3)=(25, 24,
3 15) and weights (w1, w2, w3)=(18,15,10. Obtain the optimal solution using greedy method.
(CO4-Level 6)
Draw the portion of the state space tree generated by LCBB for the knapsack instances: n=5, (P1,
4
P2,… , P5) = (12,10,5,9,3), (w1, w2, ...,w5)=(3, 5, 2, 5, 3) and M =12. (CO5-Level 6)
SCHEME OF EVALUATION
MID-II
FACULTY-INCHARGE HOD
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Design and Analysis of Algorithms
FACULTY-INCHARGE HOD
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
FACULTY-INCHARGE HOD
Results Analysis Information
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Marks(100
S.No. H.T.No. Name of Student
)
1 16271A05E9 AKARAPU REETHU 21
2 17271A0576 MD SULTHAN 20
4 17271A05C4 A. APOORVA 44
5 17271A05F0 B. RISHITHA 23
32 18271A0529 T.RISHITHA 60
FACULTY-INCHARGE HOD
RESULT ANALYSIS
Semester : II SEMESTER
RESULT DATA:
MULTISTAGE GRAPH
A multistage graph G = (V, E) is a directed graph where vertices are partitioned into k (where k > 1)
number of disjoint subsets S = {s1,s2,…,sk} such that edge (u, v) is in E, then u Є si and v Є s1 + 1 for
some subsets in the partition and |s1| = |sk| = 1.
The vertex s Є s1 is called the source and the vertex t Є sk is called sink.
G is usually assumed to be a weighted graph. In this graph, cost of an edge (i, j) is represented by c(i,
j). Hence, the cost of path from source s to sink t is the sum of costs of each edges in this path.
The multistage graph problem is finding the path with minimum cost from source s to sink t.
Example
Consider the following example to understand the concept of multistage graph.
According to the formula, we have to calculate the cost (i, j) using the following steps
Step-1: Cost (K-2, j)
In this step, three nodes (node 4, 5. 6) are selected as j. Hence, we have three options to choose the
minimum cost at this step.
Cost(3, 4) = min {c(4, 7) + Cost(7, 9),c(4, 8) + Cost(8, 9)} = 7
Cost(3, 5) = min {c(5, 7) + Cost(7, 9),c(5, 8) + Cost(8, 9)} = 5
Cost(3, 6) = min {c(6, 7) + Cost(7, 9),c(6, 8) + Cost(8, 9)} = 5
Step-2: Cost (K-3, j)
Two nodes are selected as j because at stage k - 3 = 2 there are two nodes, 2 and 3. So, the value i = 2
and j = 2 and 3.
Cost(2, 2) = min {c(2, 4) + Cost(4, 8) + Cost(8, 9),c(2, 6) +
Cost(6, 8) + Cost(8, 9)} = 8
Cost(2, 3) = {c(3, 4) + Cost(4, 8) + Cost(8, 9), c(3, 5) + Cost(5, 8)+ Cost(8, 9), c(3, 6) + Cost(6, 8)
+ Cost(8, 9)} = 10
Step-3: Cost (K-4, j)
Cost (1, 1) = {c(1, 2) + Cost(2, 6) + Cost(6, 8) + Cost(8, 9), c(1, 3) + Cost(3, 5) + Cost(5, 8) +
Cost(8, 9))} = 12
c(1, 3) + Cost(3, 6) + Cost(6, 8 + Cost(8, 9))} = 13
Hence, the path having the minimum cost is 1→ 3→ 5→ 8→ 9.
FACULTY-INCHARGE HOD
1. https://en.wikipedia.org/wiki/Divide-and-conquer_algorithm
2. https://www.cs.cmu.edu/~avrim/451f09/lectures/lect1001.pdf
3. https://www.hackerearth.com/practice/algorithms/greedy/basics-of-greedy-algorithms/tutorial/
4. https://www.geeksforgeeks.org/backtracking-algorithms/
5. http://www.cs.umsl.edu/~sanjiv/classes/cs5130/lectures/bb.pdf
CLASS TEST-I-OCT-2022
CLASS TEST-II-NOV-2022
(2*5=10 Marks)
1. Write an algorithm for collapsing find and give an example. (5M) (K2 & CO2)
2. Write an algorithm for N-Queens problem. (5M) (K2 & CO2)
3.Explain sum of subsets with an example.(5M) (K2 & CO2)
CLASS TEST-III
COs Course Outcomes: After completion of the course, the student will be able to
Analyze algorithms and estimate their best-case, worst-case and average-case
CO 1: behaviour in terms of time and space complexity.
Design appropriate algorithm for solving problems using Divide and Conquer,
CO 2: Backtracking.
Identify the suitable data structures and algorithm design methods impact the
CO 3: performance of an algorithm using dynamic programming.
Apply algorithm design principles to derive solutions for real life problems using
CO 4: greedy method.
Design deterministic and non-deterministic algorithms for tractable and intractable
CO 5: problems and classify them as P Class, NP Class, NP-Hard, NP-complete problems
Blooms
CO
Q.No Taxonomy
Question Description Mapp-
. (Knowledge
ed with
Level)
CLASS TEST-IV
COs Course Outcomes: After completion of the course, the student will be able to
Analyze algorithms and estimate their best-case, worst-case and average-case
CO 1: behaviour in terms of time and space complexity.
Design appropriate algorithm for solving problems using Divide and Conquer,
CO 2: Backtracking.
Identify the suitable data structures and algorithm design methods impact the
CO 3: performance of an algorithm using dynamic programming.
Apply algorithm design principles to derive solutions for real life problems using
CO 4: greedy method.
Design deterministic and non-deterministic algorithms for tractable and intractable
CO 5: problems and classify them as P Class, NP Class, NP-Hard, NP-complete problems
Blooms
CO
Q.No Taxonomy
Question Description Mapp-
. (Knowledge
ed with
Level)