Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add README.md for Dynamic Programming Algorithms #97

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

himanshulohote
Copy link
Contributor

Description:

This pull request introduces a new README.md file to the dynamic_programming directory. The file provides comprehensive documentation for the dynamic programming algorithms implemented in this directory.

Changes Introduced:

  • Added README.md to the dynamic_programming directory.
  • The README includes:
    • An overview of dynamic programming and its purpose.
    • Descriptions of the various algorithms implemented, including their purpose and time complexity.
    • References to relevant literature and external resources for further reading.

Details:

  • Coin Change Problem (coin_change.rs): Determines the minimum number of coins needed to make a given amount. Time Complexity: O(n * m), where n is the amount and m is the number of coin types.
  • Edit Distance (edit_distance.rs): Calculates the minimum number of operations required to convert one string into another. Time Complexity: O(m * n), where m and n are the lengths of the two strings.
  • Egg Dropping Problem (egg_dropping.rs): Determines the minimum number of attempts needed to find the highest floor from which an egg can be dropped without breaking. Time Complexity: O(k * n), where k is the number of eggs and n is the number of floors.
  • Fibonacci Sequence (fibonacci.rs): Computes the nth Fibonacci number. Time Complexity: O(n)
  • Knapsack Problem (knapsack.rs): Solves the problem of selecting items with given weights and values to maximize total value without exceeding the weight capacity. Time Complexity: O(n * W), where n is the number of items and W is the weight capacity.
  • Longest Common Subsequence (longest_common_subsequence.rs): Finds the longest subsequence present in both of the given sequences. Time Complexity: O(m * n), where m and n are the lengths of the two sequences.
  • Longest Increasing Subsequence (longest_increasing_subsequence.rs): Finds the length of the longest subsequence of a given sequence such that all elements of the subsequence are sorted in increasing order. Time Complexity: O(n^2) with dynamic programming approach.
  • Maximum Subarray (maximum_subarray.rs): Finds the contiguous subarray within a one-dimensional array of numbers which has the largest sum. Time Complexity: O(n)
  • Rod Cutting Problem (rod_cutting.rs): Determines the maximum revenue obtainable by cutting up a rod and selling the pieces. Time Complexity: O(n^2)

References:

Motivation:

Adding this README will provide users with a clear understanding of the dynamic programming algorithms included in this directory, their implementations, and their complexities. It will also offer direct links to resources for further study, improving the overall documentation quality of the repository.

Related Issue:

Copy link
Owner

@alexfertel alexfertel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for your contribution!

@alexfertel alexfertel merged commit efcd869 into alexfertel:main Aug 21, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants