Skip to content

Commit

Permalink
Updated the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Richajaishwal0 committed Nov 4, 2024
1 parent 3ac10be commit 766968f
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 216 deletions.
12 changes: 9 additions & 3 deletions docs/Recursion-depths/Recursion.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
| id | sidebar_position | title | sidebar_label | tags |
|----------------------------|------------------|---------------------------|-----------------------------|----------------------|
| recursion-depth-overview | 1 | Recursion Depth Overview | Overview | recursion, algorithms, depth |
---
id: recursion-depth-overview
title: Recursion Depth Overview
sidebar_label: Overview
sidebar_position: 5
description: An overview of recursion depth and its role in recursive algorithms.
tags: [recursion, algorithms, depth]
---


# Recursion Depth Overview

Expand Down
14 changes: 9 additions & 5 deletions docs/Recursion-depths/advanced-topics.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@

---
Advanced topics in recursion, including dynamic programming and recursion depth in complex algorithms.
| ID | Title | Sidebar Label | Sidebar Position | Description | Tags |
|-------------------------|-------------------------------|------------------|------------------|--------------------------------------------------------|--------------------------|
| recursion-depth-advanced | Advanced Recursion Depth Topics| Advanced Topics | 8 | Advanced concepts related to recursion depth, including dynamic programming and backtracking. | advanced, recursion, algorithms |
id: recursion-depth-advanced
title: Advanced Recursion Depth Topics
sidebar_label: Advanced Topics
sidebar_position: 1
description: Advanced concepts related to recursion depth, including dynamic programming and backtracking.
tags: [advanced, recursion, algorithms]
---



# Advanced Recursion Depth Topics

Expand Down
11 changes: 8 additions & 3 deletions docs/Recursion-depths/basic-concepts.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
---
id: recursion-depth-basic-concepts
title: Basic Concepts of Recursion Depth
sidebar_label: Basic Concepts
sidebar_position: 2
description: Introduction to recursion and understanding recursion depth.
tags: [recursion, depth, basics]
---

| ID | Title | Sidebar Label | Sidebar Position | Description | Tags |
|----------------------------|-----------------------------------|------------------|------------------|--------------------------------------------------------|---------------------------|
| recursion-depth-basic-concepts | Basic Concepts of Recursion Depth | Basic Concepts | 2 | Introduction to recursion and understanding recursion depth. | recursion, depth, basics |
# Basic Concepts of Recursion Depth

Recursion is a programming technique where a function calls itself in order to solve smaller instances of a problem. The recursion depth is the total number of recursive calls in a function.
Expand Down
98 changes: 0 additions & 98 deletions docs/Recursion-depths/examples/binary-search-depth.md

This file was deleted.

48 changes: 0 additions & 48 deletions docs/Recursion-depths/examples/factorial-depth.md

This file was deleted.

48 changes: 0 additions & 48 deletions docs/Recursion-depths/examples/fibonacci-depth.md

This file was deleted.

16 changes: 11 additions & 5 deletions docs/Recursion-depths/handling-depth-errors.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
| ID | Title | Sidebar Label | Sidebar Position | Description | Tags |
|---------------------------|--------------------------------|---------------|------------------|---------------------------------------------------------------|-------------------------------|
| recursion-depth-errors | Handling Recursion Depth Errors | Depth Errors | 7 | Handling stack overflow and other errors due to high recursion depth. | errors, recursion, stack-overflow |
---
id: recursion-depth-errors
title: Handling Recursion Depth Errors
sidebar_label: Depth Errors
sidebar_position: 3
description: Handling stack overflow and other errors due to high recursion depth.
tags: [errors, recursion, stack-overflow]
---

# Handling Recursion Depth Errors

Expand All @@ -21,7 +26,8 @@ Recursion is a powerful programming technique, but when the recursion depth exce
### 1. Set a Limit
- Some programming languages, like Python, allow you to adjust the maximum recursion depth. You can set a higher limit if necessary, but be cautious as this might lead to stack overflow.
- **Example**:
```python

```python
import sys
sys.setrecursionlimit(1000) # Set recursion limit to 1000
```
Expand Down Expand Up @@ -49,6 +55,6 @@ def factorial(n):
elif n == 0 or n == 1:
return 1
return n * factorial(n - 1)

```
### Summary
Handling recursion depth errors is essential for creating reliable recursive functions. Always check for potential stack overflow and infinite recursion, and consider using iterative solutions when necessary to enhance your program's stability and performance.
14 changes: 8 additions & 6 deletions docs/Recursion-depths/performance-consideration.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
id: recursion-depth-performance
title: Recursion Depth and Performance
sidebar_label: Performance Considerations
sidebar_position: 4
description: Understanding how recursion depth affects algorithm performance.
tags: [performance, recursion, optimization]
---

Discussion on how recursion depth impacts performance, with tips to optimize.


| ID | Title | Sidebar Label | Sidebar Position | Description | Tags |
|---------------------------|---------------------------------|--------------------------|------------------|----------------------------------------------------------|--------------------------------|
| recursion-depth-performance| Recursion Depth and Performance | Performance Considerations | 6 | Understanding how recursion depth affects algorithm performance. | performance, recursion, optimization

# Recursion Depth and Performance

Expand Down

0 comments on commit 766968f

Please sign in to comment.