Ayu-hack / Hacktoberfest2024-1

This is repo to create some pull requests and completing hacktoberfest 2024 easily. All request will be accepted. Genuine Pull Request will promoted also. #hacktobefest #hacktobefest2024 #hacktobefest-accepted Resources
46 stars 467 forks source link

Implement Various Approaches to learn the concept of Recursion and various coding question to practise and projects #95

Closed abhisheksaxena15 closed 1 month ago

abhisheksaxena15 commented 1 month ago

Recursion is a powerful problem-solving technique where a function calls itself to solve smaller instances of the same problem. This document provides advanced recursion topics, algorithms, and frequently asked interview questions to deepen your understanding and practice.

Key Concepts in Recursion

  1. Base Case: The condition that stops recursion, preventing infinite calls; Time Complexity: O(1).

  2. Recursive Case: The function calls itself with modified parameters to solve smaller instances of the problem; Time Complexity: Varies based on the problem.

  3. Stack Overflow: Occurs when the recursion exceeds the call stack limit, typically due to a missing base case; Time Complexity: N/A.

  4. Memoization: An optimization that stores previously computed results to avoid redundant calculations; Time Complexity: O(n) for top-level calls.

  5. Tail Recursion: When the recursive call is the last operation, allowing for potential compiler optimization; Time Complexity: O(1) space due to optimization.

Tasks Implement Recursive Algorithms: Fibonacci Sequence: Write a recursive function to find the nth Fibonacci number. Factorial Calculation: Create a recursive function to calculate the factorial of a number. Sum of Digits: Develop a recursive function to compute the sum of the digits of a number. Tower of Hanoi: Solve the Tower of Hanoi problem using recursion. Permutations of a String: Generate all permutations of a given string recursively. Power Set: Create a function to generate the power set of a set using recursion.

@Ayu-hack Please assign me this issue under hacktober-fest.

Ayu-hack commented 1 month ago

Assigned. More repos are available for pull requests, and they’re part of Hacktoberfest 2024. Feel free to tag me in your Hacktoberfest certificate or badges LinkedIn post! 😄 👉 Follow my GitHub and connect with me on LinkedIn! ⭐ Star these repos to stay updated for next year’s Hacktoberfest!

abhisheksaxena15 commented 1 month ago

Assigned. More repos are available for pull requests, and they’re part of Hacktoberfest 2024. Feel free to tag me in your Hacktoberfest certificate or badges LinkedIn post! 😄 👉 Follow my GitHub and connect with me on LinkedIn! ⭐ Star these repos to stay updated for next year’s Hacktoberfest!

Thank you , will be completing withing 2 or 3 days

abhisheksaxena15 commented 1 month ago

Done with the pull request please verify