Skip to content

arya2004/algorithms

Design and Analysis of Algorithms (DAA) Lab

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.


Code Structure

The src directory contains the following folders, each representing a specific topic:

  1. 01_dearrangements: Implementation of dearrangement algorithms.
  2. 01_random_permutation: Random permutation generation.
  3. 02_quick_merge_sort: Quick sort and k-way merge sort implementations.
  4. 03_Josephers: Josephus problem solutions.
  5. 04_searching: Searching algorithms.
  6. 05_Fast_Modulo_Exponent: Fast modular exponentiation.
  7. 06_longest_increasing_subsequence: Longest increasing subsequence algorithms.
  8. 07_kadance: Kadane's algorithm for maximum subarray sum.
  9. 08_huffman: Huffman coding implementation.

How to Run

  1. Navigate to the desired folder inside the src directory.
  2. Compile the code using a C++ compiler. For example, to compile main.cpp in the 01_dearrangements folder, run:
    g++ main.cpp -o main
  3. Execute the compiled file. For example:
    ./main

Make sure you have a C++ compiler installed and properly configured in your system's PATH.


Contributing

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.


License

This repository is licensed under the MIT License. Feel free to use and modify the code for educational purposes.

About

Design and Analysis of Algorithms (DAA) Lab

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors 13