Git Product home page Git Product logo

java-recursion's Introduction

Recursion in Java

This repository contains a collection of standard recursion problems implemented in Java. It is designed to help you understand and practice recursion by solving problems ranging from basic to advanced difficulty levels.

Problem Set

The repository includes the following recursion problems:

  1. Factorial: Calculate the factorial of a given number.
  2. Fibonacci: Generate the nth Fibonacci number.
  3. Sum of Digits: Compute the sum of digits of a given number.
  4. Power: Calculate the power of a number.
  5. Greatest Common Divisor: Find the greatest common divisor of two numbers.
  6. Tiling Problem: Calculate the number of ways to tile a given area using 1x2 tiles.
  7. Power of N: Calculate the power of a number raised to the nth power.
  8. First Occurrence of Element: Find the index of the first occurrence of a given element in an array.
  9. Remove Duplicates: Remove duplicates from an array.
  10. Permutations: Generate all permutations of a given string.

Each problem is implemented in Java and includes a detailed explanation and the corresponding recursive solution.

How to Use

To use this repository, follow these steps:

  1. Clone the repository to your local machine using the following command:
    git clone https://github.com/akanksha042/JAVA-Recursion.git
    
  2. Open the project in your favorite Java IDE.
  3. Navigate to the problem of your choice and explore the solution.
  4. Modify and experiment with the code as needed.
  5. Run the program to see the results and test different inputs.
  6. Learn from the comments and explanations provided in the code to understand the recursive approach.

Feel free to contribute to the repository by adding more recursion problems or improving existing solutions. Simply fork the repository, make your changes, and create a pull request.

Remember, practice is the key to mastering recursion. Happy coding!

java-recursion's People

Contributors

akanksha042 avatar

Watchers

 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.