ADA lab Expectation setting ppts
ADA lab Expectation setting ppts
of Algorithm Lab
CO U R S E : ( A DA L A B ) B C S L 4 0 4
I N S T RU C TO R : M S . JAYAS H R E E / M S . A NA N S WA R A / M S . N I D H I
J O S H I PA RS A I / M S . K AV I T H A
Lab Objectives
- Design and implement algorithms in C/C++
- Apply different algorithm design strategies
- Measure and compare algorithm performance
- Solve computational problems using various techniques
What is an Algorithm?
- A step-by-step procedure to solve a problem
- Input → Process → Output
- Example: Algorithm for adding two numbers
Characteristics of a
Good Algorithm
- Correctness: Produces the correct output for valid inputs
- Efficiency: Optimized for time and space
- Finiteness: Must terminate after a finite number of steps
- Simplicity: Easy to understand and implement
- Generality: Can solve a class of problems
Algorithm Analysis
- Time Complexity: Measures execution time
- Space Complexity: Measures memory usage
- Asymptotic Notation: Big-O, Big-Ω, Big-Θ
Time Complexity
Examples
- Constant Time: O(1)
- Linear Time: O(n)
- Quadratic Time: O(n²)
- Logarithmic Time: O(log n)
- Example: Analyzing a loop
Space Complexity
- Definition: Memory required by an algorithm
- Fixed part + Variable part
- Example: Recursive function space usage
Algorithm Design
Techniques
- Divide & Conquer
- Greedy Method
- Dynamic Programming
- Backtracking
- Example problems for each
General Lab
Expectations
- Submit well-documented code for each experiment
- Compare time complexity of different approaches
- Maintain a proper lab journal with observations
- Use proper coding standards and best practices
Assessment Criteria
- CIE: 50 Marks (Assignments, Lab Record, Internal Tests)
- SEE: 50 Marks (Lab Exam, Viva, Execution of Programs)
- Minimum passing: 40% in CIE and SEE
Programming
Guidelines
- Use proper indentation and comments
- Optimize time and space complexity
- Follow modular programming principles
- Test code for correctness and efficiency
Lab Expectations
- Implement basic sorting and searching algorithms
- Measure time complexity using programming
- Compare different algorithms based on efficiency
- Document and analyze results
Lab Experiments
Overview
- Implement Minimum Cost Spanning Tree (Kruskal & Prim)
- Shortest Path Algorithms (Floyd, Dijkstra)
- Sorting (Selection, Quick, Merge Sort)
- Knapsack Problem (Dynamic & Greedy Methods)
- Backtracking (N-Queens, Subset Sum)
Lab Record
Maintenance
- Maintain a neatly written lab record
- Include problem statement, algorithm, code, output, and analysis
- Submit records on time for evaluation
Conclusion and Next
Steps
- Follow lab guidelines and coding best practices
- Implement and analyze all assigned algorithms
- Prepare for lab exams with proper practice
- Seek help from instructors whenever needed
References
Textbooks
1. Introduction to the Design and Analysis of Algorithms, By Anany
Levitin, 3rd Edition (Indian), 2017, Pearson.
Reference books
1. Computer Algorithms/C++, Ellis Horowitz, Satra Sahni and Rajasekaran,
2nd Edition, 2014, Universities Press.