This repository contains lab codes for the Design and Analysis of Algorithms (DAA) course, providing practical implementations of key algorithmic concepts and design strategies. The codes are organized by topics as per the course syllabus.
The src
directory contains the following folders, each representing a specific topic:
- 01_dearrangements: Implementation of dearrangement algorithms.
- 01_random_permutation: Random permutation generation.
- 02_quick_merge_sort: Quick sort and k-way merge sort implementations.
- 03_Josephers: Josephus problem solutions.
- 04_searching: Searching algorithms.
- 05_Fast_Modulo_Exponent: Fast modular exponentiation.
- 06_longest_increasing_subsequence: Longest increasing subsequence algorithms.
- 07_kadance: Kadane's algorithm for maximum subarray sum.
- 08_huffman: Huffman coding implementation.
- Navigate to the desired folder inside the
src
directory. - Compile the code using a C++ compiler. For example, to compile
main.cpp
in the01_dearrangements
folder, run:g++ main.cpp -o main
- Execute the compiled file. For example:
./main
Make sure you have a C++ compiler installed and properly configured in your system's PATH.
Feel free to contribute to this repository by submitting bug fixes, optimizations, or additional examples. Make sure to follow the course structure while adding new codes.
This repository is licensed under the MIT License. Feel free to use and modify the code for educational purposes.