Code Monkey home page Code Monkey logo

dynamicprogramming's Introduction

Dynamic Programming Repository: Classic Problems Solved ๐Ÿš€

Welcome to my dynamic programming repository where I explore and explain solutions to classic problems using both recursion and dynamic programming techniques. This repository serves as a practical reference for coding enthusiasts interested in understanding and applying dynamic programming strategies to solve problems efficiently.

Table of Contents ๐Ÿ“š

About the Repository

This repository includes Python scripts that demonstrate dynamic programming and recursion solutions to well-known problems, currently featuring:

Each solution is discussed with respect to both its recursive and dynamic programming implementations, including analysis of time and space complexities.

Installation ๐Ÿ’ฝ

To clone and run these scripts locally, use the following commands:

git clone https://github.com/yourusername/dynamic-programming-problems.git
cd dynamic-programming-problems

Problems Solved

All Problems

  • Longest Palindromic Substring (Leetcode 5)
  • Generate Parentheses (Leetcode 22)
  • Jump Game II (Leetcode 45)
  • Maximum Subarray (Leetcode 53)
  • Edit Distance (Leetcode 72)
  • Decode Ways (Leetcode 91)
  • Interleaving String (Leetcode 97)
  • Pascal's Triangle (Leetcode 118)
  • Pascal's Triangle II (Leetcode 119)
  • Best Time to Buy and Sell Stock (Leetcode 121)
  • Counting Bits (Leetcode 338)
  • Is Subsequence (Leetcode 392)
  • Divisor Game (Leetcode 1025)

Fibonacci Sequence ๐Ÿงฌ

Description: The Fibonacci sequence is a series of numbers where a number is the sum of the two preceding ones, usually starting with 0 and 1.

Example Usage:

python fibonacci.py 10

Detailed Analysis: Includes performance comparison of recursive vs dynamic programming approaches with visual aids.

Climbing Stairs ๐Ÿง—โ€โ™‚๏ธ

Description: Determine the number of ways to climb n steps when you can climb either one or two steps at a time.

Example Usage:

python climbing_stairs.py 5

Detailed Analysis: Focuses on optimizing the recursive solution using dynamic programming techniques to reduce time complexity from exponential to polynomial.

Usage ๐Ÿš€

To run any script, navigate to the specific problem directory and run the Python script with an appropriate argument. For example:

python fibonacci.py 10

Replace 10 with any number to compute its Fibonacci value using dynamic programming.

Contributing ๐Ÿค

Contributions to improve the existing solutions or add new problem solutions are welcome. Please fork the repository, make your changes, and submit a pull request.

License ๐Ÿ“„

This project is licensed under the MIT License - see the LICENSE.md file for details.

Contact ๐Ÿ“ง

If you have any questions or suggestions, please contact me via GitHub email.

Acknowledgments ๐ŸŽ‰

Special thanks to:

  • Towards Data Science and Geek Culture for hosting the articles that inspired these solutions.
  • Contributors and readers who provide valuable feedback and suggestions.

dynamicprogramming's People

Contributors

hzmsh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.