Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
gsilvamartin committed Feb 24, 2024
2 parents 0012314 + 43ec5c0 commit 0e5082e
Show file tree
Hide file tree
Showing 14 changed files with 800 additions and 21 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Custom issue template
about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''

---


20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
# NetPlus
<p align="center"><img width="350" alt="logo" src="https://github.com/gsilvamartin/netplus/assets/42881020/c00b7700-b2a3-4949-a720-6d9b2c44ab1a"></p>

##


Welcome to NetPlus, an expansive toolkit meticulously crafted for .NET developers. This comprehensive suite of modules is designed to enhance various facets of your application development journey. Let's embark on a journey through each module, exploring a rich tapestry of functionalities and additional examples.

## 1. NetPlus.Algorithms 🧠

Dive into the `NetPlus.Algorithms` namespace, a treasure trove of algorithmic solutions providing a robust foundation for computational tasks. Beyond essentials like Breadth-First Search (BFS) and A*, uncover additional gems like Depth-First Search (DFS), Dijkstra's algorithm, and QuickSort. These algorithms ensure versatility and adaptability in addressing complex computational challenges.

## 2. NetPlus.Comparison 🔍

Within `NetPlus.Comparison`, gain access to a versatile suite of tools for nuanced data analysis. Complementing cosine similarity and Jaccard index, explore additional comparisons like Hamming distance, Levenshtein distance, and Pearson correlation. This module equips you with a diversified set of tools for precise and insightful comparisons in your data processing workflows.

## 3. NetPlus.Converters 🔄
## 2. NetPlus.Converters 🔄

In `NetPlus.Converters`, elevate your data transformation capabilities with an extended repertoire of converters. Beyond fundamental date-to-string conversions, explore utilities for binary-to-text conversion, JSON serialization, and custom object-to-object conversions. These utilities provide a flexible and robust foundation for managing diverse data types, ensuring seamless interoperability.

## 4. NetPlus.Generators 🛠️
## 3. NetPlus.Generators 🛠️

Unleash the power of synthetic data generation within `NetPlus.Generators`. Beyond creating fictitious data for common data structures, explore utilities for generating random graphs, mock HTTP responses, and simulating user interactions. These functionalities amplify your testing capabilities, allowing for a more comprehensive evaluation of your application's robustness.

## 5. NetPlus.Validations ✔️
## 4. NetPlus.Validations ✔️

Dive deeper into data integrity and validation within `NetPlus.Validations`. Beyond email validation, explore utilities for checking numeric ranges, string lengths, and implementing custom validation conditions. These extensions provide a holistic approach to ensuring data accuracy and consistency throughout your application.

## 6. NetPlus.ServiceAbstractions 🌐
## 5. NetPlus.ServiceAbstractions 🌐

Extend your service integration capabilities in `NetPlus.ServiceAbstractions`. Beyond Redis and MongoDB, explore abstractions for popular services such as Azure Storage, Elasticsearch, and more. This module facilitates seamless integration and ensures your application remains adaptable to evolving service requirements.

Expand Down
4 changes: 2 additions & 2 deletions docs/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"output": "_site",
"template": ["default", "modern"],
"globalMetadata": {
"_appName": "netplus",
"_appTitle": "netplus",
"_appName": "NetPlus",
"_appTitle": "NetPlus",
"_enableSearch": true,
"pdf": true
}
Expand Down
84 changes: 84 additions & 0 deletions docs/docs/algorithms/search/astarsearch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# AStarSearch<T> Class

**A* Search algorithm implementation for finding the shortest path in a weighted graph.**

## AStarSearch<T> Class Members

```csharp
SearchAStar(
Dictionary<T, List<(T, int)>> graph,
T start,
T goal,
Func<T, T, int> heuristic)
```

Performs A* search on a weighted graph to find the shortest path from the start to the goal.

## Parameters

- `graph` (Type: `Dictionary<T, List<(T, int)>>`): The weighted graph represented as a dictionary.
- `start` (Type: `T`): The starting node.
- `goal` (Type: `T`): The goal node.
- `heuristic` (Type: `Func<T, T, int>`): Heuristic function estimating the cost from a node to the goal.

## Returns

- Type: `List<T>`
- Description: The shortest path from the start to the goal.

## Example

```csharp
using NetPlus.Algorithms.Search;

// Example weighted graph represented as a dictionary
var weightedGraph = new Dictionary<int, List<(int, int)>>
{
{ 0, new List<(int, int)> { (1, 5), (2, 3) } },
{ 1, new List<(int, int)> { (3, 7) } },
{ 2, new List<(int, int)> { (4, 2) } },
{ 3, new List<(int, int)> { (5, 1) } },
{ 4, new List<(int, int)> { (5, 5) } },
{ 5, new List<(int, int)> { } }
};

// Heuristic function (Euclidean distance in this case)
Func<int, int, int> euclideanHeuristic = (node, goal) =>
{
// Implement your heuristic function here
return Math.Abs(node - goal);
};

// Performing A* search
var shortestPath = AStarSearch<int>.SearchAStar(weightedGraph, 0, 5, euclideanHeuristic);

// Displaying the shortest path
Console.WriteLine(string.Join(" -> ", shortestPath));
```

## Usage

To use the AStarSearch<T> class, simply call the `SearchAStar` method with the appropriate parameters.

```csharp
// Example usage
var shortestPath = AStarSearch<int>.SearchAStar(weightedGraph, startNode, goalNode, heuristicFunction);
```

## Remarks

The `AStarSearch<T>` class uses the A* Search algorithm to find the shortest path in a weighted graph. It requires a heuristic function to estimate the cost from a node to the goal.

```csharp
// Example of a custom heuristic function
Func<int, int, int> customHeuristic = (node, goal) =>
{
// Implement your custom heuristic function here
return Math.Abs(node - goal) * 2;
};

// Performing A* search with a custom heuristic function
var customShortestPath = AStarSearch<int>.SearchAStar(weightedGraph, 0, 5, customHeuristic);
```

In the above example, a custom heuristic function is used to perform A* search with a different estimation of the cost from a node to the goal.
55 changes: 55 additions & 0 deletions docs/docs/algorithms/search/binarysearch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# BinarySearch Class

**A static class containing the implementation of Binary Search algorithm.**

## BinarySearch Class Members

```csharp
SearchBinary<T>(this T[] array, T value) where T : IComparable<T>
```

Performs binary search on a sorted array to find the index of a specific value.

## Parameters

- `array` (Type: `T[]`): The sorted array to search.
- `value` (Type: `T`): The value to search for.

## Returns

- Type: `int`
- Description: The index of the value in the array, or -1 if not found.

## Example

```csharp
using NetPlus.Algorithms.Search;

// Example sorted array
var sortedArray = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 };

// Using BinarySearch to find the index of a value
var index = sortedArray.SearchBinary(5);

// Displaying the result
Console.WriteLine("Index of 5: " + index);
```

## Usage

To use the BinarySearch class, call the `SearchBinary` method on your sorted array.

```csharp
// Example usage
var index = sortedArray.SearchBinary(targetValue);
```

## Remarks

The BinarySearch class provides a static method for performing binary search on a sorted array to find the index of a specific value. It utilizes a recursive approach to divide the search range until the value is found or the range becomes empty.

```csharp
// Example of usage with a custom array type
var customArray = new CustomType[] { /* initialize your custom array */ };
var customIndex = customArray.SearchBinary(customValue);
```
49 changes: 49 additions & 0 deletions docs/docs/algorithms/sorting/bubblesort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# BubbleSort Class

Provides methods for performing Bubble Sort on arrays.

## BubbleSort Class Members

```csharp
ExecuteBubbleSort<T>(this T[] array) where T : IComparable<T>
```

Sorts an array using the Bubble Sort algorithm in ascending order.

## Parameters

- `array` (Type: `T[]`): The array to be sorted.

## Returns

- Type: `T[]`
- Description: The sorted array in ascending order.

## Example

```csharp
using NetPlus.Algorithms.Sorting;

// Example array
int[] myArray = { 4, 2, 7, 1, 9 };

// Sorting the array using Bubble Sort
var sortedArray = myArray.ExecuteBubbleSort();

// Displaying the sorted array
Console.WriteLine(string.Join(", ", sortedArray));
```

## Usage

To use the BubbleSort class, simply call the ExecuteBubbleSort method on your array.

```csharp
int[] myArray = { 4, 2, 7, 1, 9 };
var sortedArray = BubbleSort.ExecuteBubbleSort(myArray);
```

## Remarks

The BubbleSort class uses the Bubble Sort algorithm to sort arrays in ascending order.
It is an in-place sorting algorithm.
48 changes: 48 additions & 0 deletions docs/docs/algorithms/sorting/heapsort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# HeapSort Class

**Provides methods for performing Heap Sort on arrays.**

## HeapSort Class Members

```csharp
Sort<T>(this T[] array) where T : IComparable<T>
```

Sorts an array using the Heap Sort algorithm.

## Parameters

- `array` (Type: `T[]`): The array to be sorted.

## Returns

- Type: `T[]`
- Description: The sorted array.

## Example

```csharp
using NetPlus.Algorithms.Sorting;

// Example array
int[] myArray = { 4, 2, 7, 1, 9 };

// Sorting the array using Heap Sort
var sortedArray = myArray.ExecuteHeapSort();

// Displaying the sorted array
Console.WriteLine(string.Join(", ", sortedArray));
```

## Usage

To use the HeapSort class, simply call the `ExecuteHeapSort` method on your array.

```csharp
int[] myArray = { 4, 2, 7, 1, 9 };
var sortedArray = HeapSort.ExecuteHeapSort(myArray);
```

## Remarks

The `HeapSort` class uses the Heap Sort algorithm to sort arrays. It is an in-place sorting algorithm.
Loading

0 comments on commit 0e5082e

Please sign in to comment.