From 24616a0efa3e3b5000c736d0cb0faac6766e9b64 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Wed, 21 Feb 2024 23:55:16 -0300 Subject: [PATCH 01/33] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0b43a8c..129da93 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ -# NetPlus +

logo

+ +## + 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. From f65da666f5184e6ecd0ae27c50d4bd1a8089545f Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Wed, 21 Feb 2024 23:56:12 -0300 Subject: [PATCH 02/33] Update README.md --- README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 129da93..457c66c 100644 --- a/README.md +++ b/README.md @@ -9,23 +9,19 @@ Welcome to NetPlus, an expansive toolkit meticulously crafted for .NET developer 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. From ffe0f2f2f8ace55afd2b8360161b73d101138cf5 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Thu, 22 Feb 2024 19:59:12 -0300 Subject: [PATCH 03/33] Update index.md --- docs/index.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/index.md b/docs/index.md index 6023cdd..1b13a95 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,11 +1,7 @@ ---- -_layout: landing ---- - # This is the **HOMEPAGE**. Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files. ## Quick Start Notes: -1. Add images to the *images* folder if the file is referencing an image. \ No newline at end of file +1. Add images to the *images* folder if the file is referencing an image. From da397e06a4d2400b7208ee73971f0d70315b807c Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Fri, 23 Feb 2024 22:50:49 -0300 Subject: [PATCH 04/33] Update introduction.md --- docs/docs/introduction.md | 159 +++++++++++++++++++++++++++++++++++++- 1 file changed, 158 insertions(+), 1 deletion(-) diff --git a/docs/docs/introduction.md b/docs/docs/introduction.md index f6ecaa6..51d0656 100644 --- a/docs/docs/introduction.md +++ b/docs/docs/introduction.md @@ -1 +1,158 @@ -# Introduction \ No newline at end of file +

+ +

+ +## + +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. + +# NetPlus.Algorithms + +> [!NOTE] +> Explore specialized classes for sorting algorithms (Sorting), graphs (Graph), comparison +> (Comparison), and search (Search). + + + +# NetPlus.Converters + +> [!NOTE] +> NetPlus.Converters provides versatile data transformation tools, including binary-to-text, +> JSON serialization, and custom object-to-object conversions. + +
    +
  • +
    + + Date + + + +
    + +
  • + +
  • +
    + + Temperature + + + +
    + +
  • +
      From 3fc759a222a33e37c1bb5ed65fa1ecf911001e4d Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Fri, 23 Feb 2024 22:56:34 -0300 Subject: [PATCH 05/33] Update introduction.md --- docs/docs/introduction.md | 187 ++++++++------------------------------ 1 file changed, 40 insertions(+), 147 deletions(-) diff --git a/docs/docs/introduction.md b/docs/docs/introduction.md index 51d0656..45aa2b3 100644 --- a/docs/docs/introduction.md +++ b/docs/docs/introduction.md @@ -1,158 +1,51 @@

      - +

      -## +--- -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. +# Welcome to NetPlus -# NetPlus.Algorithms +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. -> [!NOTE] -> Explore specialized classes for sorting algorithms (Sorting), graphs (Graph), comparison -> (Comparison), and search (Search). - - - -# NetPlus.Converters +## NetPlus.Algorithms > [!NOTE] -> NetPlus.Converters provides versatile data transformation tools, including binary-to-text, -> JSON serialization, and custom object-to-object conversions. +> Explore specialized classes for sorting algorithms (Sorting), graphs (Graph), comparison (Comparison), and search (Search). + +- **Comparison** + - [Cosine Similarity](https://example.com/cosine) + - [Jaccard Similarity](https://example.com/jaccard) + - [JansenShannon Similarity](https://example.com/jansenshannon) + - [Jarc Winkler Similarity](https://example.com/jarcwinkler) + - [Levenshtein Similarity](https://example.com/levenshtein) + - [NGram Similarity](https://example.com/ngram) + +- **Graph** + - [Breadth-First Search](https://example.com/bfs) + - [Depth-First Search](https://example.com/dfs) + +- **Search** + - [A*](https://example.com/a-star) + - [Binary](https://example.com/binary) + - [Fibonacci](https://example.com/fibonacci) + - [Interpolated](https://example.com/interpolated) + - [Jump Search](https://example.com/jump) + - [Ternary Search](https://example.com/ternary) + +- **Sorting** + - [Bubble Sort](https://example.com/bubble) + - [Heap Sort](https://example.com/heap) + - [Merge Sort](https://example.com/merge) + - [Selection Sort](https://example.com/selection) + +## NetPlus.Converters -
        -
      • -
        - - Date - - - -
        - -
      • - -
      • -
        - - Temperature - +> [!NOTE] +> NetPlus.Converters provides versatile data transformation tools, including binary-to-text, JSON serialization, and custom object-to-object conversions. - -
        +- **Date** + - [Date Converter](https://example.com/cosine) -
      • -
          +- **Temperature** + - [Temperature Converter](https://example.com/cosine) From a612b50be051e8a26ed53f7ecd292a6751936df3 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Fri, 23 Feb 2024 23:00:41 -0300 Subject: [PATCH 06/33] Update introduction.md --- docs/docs/introduction.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/docs/introduction.md b/docs/docs/introduction.md index 45aa2b3..54e1182 100644 --- a/docs/docs/introduction.md +++ b/docs/docs/introduction.md @@ -2,9 +2,7 @@

          ---- - -# Welcome to NetPlus +## 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. @@ -49,3 +47,18 @@ Welcome to NetPlus, an expansive toolkit meticulously crafted for .NET developer - **Temperature** - [Temperature Converter](https://example.com/cosine) + + +## NetPlus.Converters + +> [!NOTE] +> Enhance testing with NetPlus.Generators, generating synthetic data for various structures, including random graphs, mock HTTP responses, and simulated user interactions. + +- **Generic Generator** + - [Data Generator]("#") + +- **GUID Generator** + - [Guid Generator]("#") + +- **Password Generator** + - [Password GeneratorGenerator]("#") From 9f3d0f54e8610b4a4f4fd9a177a1e84ba9da99a2 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Fri, 23 Feb 2024 23:08:41 -0300 Subject: [PATCH 07/33] Update introduction.md --- docs/docs/introduction.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docs/docs/introduction.md b/docs/docs/introduction.md index 54e1182..4406442 100644 --- a/docs/docs/introduction.md +++ b/docs/docs/introduction.md @@ -62,3 +62,34 @@ Welcome to NetPlus, an expansive toolkit meticulously crafted for .NET developer - **Password Generator** - [Password GeneratorGenerator]("#") + +## NetPlus.Validations + +> [!NOTE] +> Explore data integrity in NetPlus.Validations beyond email validation. Check numeric ranges, string lengths, and implement custom validation conditions for a holistic approach to ensuring data accuracy and consistency in your application. + +- **Date Validator** + - [Date Validator]("#") + +- **Numeric Validator** + - [Numeric Validator]("#") + +- **String Validator** + - [String Validator]("#") + +## NetPlus.ServiceAbstractions + +> [!NOTE] +> Extend your service integration capabilities in NetPlus.ServiceAbstractions. Explore abstractions for popular services like MongoDB and Redis, along with others such as Azure Storage, Elasticsearch, and more. This module ensures seamless integration and adaptability to evolving service requirements in your application. + +- **MongoDB** + - [MongoDB]("#") + +- **Redis** + - [Redis]("#") + + + + + + From a02494fd8079debf907bef37ec4c4cffb0a47a40 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Fri, 23 Feb 2024 23:11:51 -0300 Subject: [PATCH 08/33] Update index.md --- docs/index.md | 96 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 92 insertions(+), 4 deletions(-) diff --git a/docs/index.md b/docs/index.md index 1b13a95..f84c016 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,7 +1,95 @@ -# This is the **HOMEPAGE**. +

          + +

          + +## + +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. + +## NetPlus.Algorithms + +> [!NOTE] +> Explore specialized classes for sorting algorithms (Sorting), graphs (Graph), comparison (Comparison), and search (Search). + +- **Comparison** + - [Cosine Similarity](https://example.com/cosine) + - [Jaccard Similarity](https://example.com/jaccard) + - [JansenShannon Similarity](https://example.com/jansenshannon) + - [Jarc Winkler Similarity](https://example.com/jarcwinkler) + - [Levenshtein Similarity](https://example.com/levenshtein) + - [NGram Similarity](https://example.com/ngram) + +- **Graph** + - [Breadth-First Search](https://example.com/bfs) + - [Depth-First Search](https://example.com/dfs) + +- **Search** + - [A*](https://example.com/a-star) + - [Binary](https://example.com/binary) + - [Fibonacci](https://example.com/fibonacci) + - [Interpolated](https://example.com/interpolated) + - [Jump Search](https://example.com/jump) + - [Ternary Search](https://example.com/ternary) + +- **Sorting** + - [Bubble Sort](https://example.com/bubble) + - [Heap Sort](https://example.com/heap) + - [Merge Sort](https://example.com/merge) + - [Selection Sort](https://example.com/selection) + +## NetPlus.Converters + +> [!NOTE] +> NetPlus.Converters provides versatile data transformation tools, including binary-to-text, JSON serialization, and custom object-to-object conversions. + +- **Date** + - [Date Converter](https://example.com/cosine) + +- **Temperature** + - [Temperature Converter](https://example.com/cosine) + + +## NetPlus.Converters + +> [!NOTE] +> Enhance testing with NetPlus.Generators, generating synthetic data for various structures, including random graphs, mock HTTP responses, and simulated user interactions. + +- **Generic Generator** + - [Data Generator]("#") + +- **GUID Generator** + - [Guid Generator]("#") + +- **Password Generator** + - [Password GeneratorGenerator]("#") + +## NetPlus.Validations + +> [!NOTE] +> Explore data integrity in NetPlus.Validations beyond email validation. Check numeric ranges, string lengths, and implement custom validation conditions for a holistic approach to ensuring data accuracy and consistency in your application. + +- **Date Validator** + - [Date Validator]("#") + +- **Numeric Validator** + - [Numeric Validator]("#") + +- **String Validator** + - [String Validator]("#") + +## NetPlus.ServiceAbstractions + +> [!NOTE] +> Extend your service integration capabilities in NetPlus.ServiceAbstractions. Explore abstractions for popular services like MongoDB and Redis, along with others such as Azure Storage, Elasticsearch, and more. This module ensures seamless integration and adaptability to evolving service requirements in your application. + +- **MongoDB** + - [MongoDB]("#") + +- **Redis** + - [Redis]("#") + + + -Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files. -## Quick Start Notes: -1. Add images to the *images* folder if the file is referencing an image. From 38ffd72534b79c26f4424bea2b779bf1865ce9c7 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Fri, 23 Feb 2024 23:20:21 -0300 Subject: [PATCH 09/33] Update toc.yml --- docs/docs/toc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/toc.yml b/docs/docs/toc.yml index d3663b9..fc0a2e3 100644 --- a/docs/docs/toc.yml +++ b/docs/docs/toc.yml @@ -1,4 +1,4 @@ - name: Introduction - href: introduction.md + href: ../index.md - name: Getting Started - href: getting-started.md \ No newline at end of file + href: getting-started.md From 9b25570c8c81fc0a5aa28f67f591b000379896c1 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Fri, 23 Feb 2024 23:24:38 -0300 Subject: [PATCH 10/33] Update docfx.json --- docs/docfx.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docfx.json b/docs/docfx.json index fcd9bb2..3c9fb2e 100644 --- a/docs/docfx.json +++ b/docs/docfx.json @@ -26,8 +26,8 @@ "output": "_site", "template": ["default", "modern"], "globalMetadata": { - "_appName": "netplus", - "_appTitle": "netplus", + "_appName": "NetPlus", + "_appTitle": "NetPlus", "_enableSearch": true, "pdf": true } From 6f5963ad43bae821fe0b77b5e02848d3affe60a4 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Fri, 23 Feb 2024 23:32:28 -0300 Subject: [PATCH 11/33] Update toc.yml --- docs/docs/toc.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/docs/toc.yml b/docs/docs/toc.yml index fc0a2e3..e06fb5f 100644 --- a/docs/docs/toc.yml +++ b/docs/docs/toc.yml @@ -1,4 +1,7 @@ +- name: Get started - name: Introduction href: ../index.md - name: Getting Started href: getting-started.md + +- name: NetPlus Modules From c93f8c275d1b4ea7b71943f5d618003bdb3aba67 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Fri, 23 Feb 2024 23:34:04 -0300 Subject: [PATCH 12/33] Create modules-toc.yml --- docs/docs/modules-toc.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docs/docs/modules-toc.yml diff --git a/docs/docs/modules-toc.yml b/docs/docs/modules-toc.yml new file mode 100644 index 0000000..2847a34 --- /dev/null +++ b/docs/docs/modules-toc.yml @@ -0,0 +1,5 @@ +- name: Algorithms +- name: Converters +- name: Generators +- name: Validations +- name: Service Abstractions From d21d9a9a2e53b38d9e6685889779b27e8c5bb1ac Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Fri, 23 Feb 2024 23:34:40 -0300 Subject: [PATCH 13/33] Update toc.yml --- docs/docs/toc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/docs/toc.yml b/docs/docs/toc.yml index e06fb5f..6146811 100644 --- a/docs/docs/toc.yml +++ b/docs/docs/toc.yml @@ -5,3 +5,4 @@ href: getting-started.md - name: NetPlus Modules + href: modules-toc.yml From 3369c9404d7836d4c1c6a598396aa4be16e60f67 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Fri, 23 Feb 2024 23:43:18 -0300 Subject: [PATCH 14/33] Update toc.yml --- docs/docs/toc.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/docs/toc.yml b/docs/docs/toc.yml index 6146811..7908d5a 100644 --- a/docs/docs/toc.yml +++ b/docs/docs/toc.yml @@ -5,4 +5,8 @@ href: getting-started.md - name: NetPlus Modules - href: modules-toc.yml + - name: Algorithms + - name: Converters + - name: Generators + - name: Validations + - name: Service Abstractions From d270bfbfd24e385ae60060fa329aae9f61de0f95 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Fri, 23 Feb 2024 23:45:18 -0300 Subject: [PATCH 15/33] Delete docs/docs/modules-toc.yml --- docs/docs/modules-toc.yml | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 docs/docs/modules-toc.yml diff --git a/docs/docs/modules-toc.yml b/docs/docs/modules-toc.yml deleted file mode 100644 index 2847a34..0000000 --- a/docs/docs/modules-toc.yml +++ /dev/null @@ -1,5 +0,0 @@ -- name: Algorithms -- name: Converters -- name: Generators -- name: Validations -- name: Service Abstractions From ba420a67d5dbb2e0539f6c700f435bf0e0bf33ec Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Fri, 23 Feb 2024 23:49:26 -0300 Subject: [PATCH 16/33] Update toc.yml --- docs/docs/toc.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/docs/toc.yml b/docs/docs/toc.yml index 7908d5a..41a4803 100644 --- a/docs/docs/toc.yml +++ b/docs/docs/toc.yml @@ -6,7 +6,16 @@ - name: NetPlus Modules - name: Algorithms + href: ../index.md + - name: Converters + href: ../index.md + - name: Generators + href: ../index.md + - name: Validations + href: ../index.md + - name: Service Abstractions + href: ../index.md From 390035d9f77be515da183601bc493deef1655896 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Fri, 23 Feb 2024 23:54:54 -0300 Subject: [PATCH 17/33] Update toc.yml --- docs/docs/toc.yml | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/docs/docs/toc.yml b/docs/docs/toc.yml index 41a4803..33a52f0 100644 --- a/docs/docs/toc.yml +++ b/docs/docs/toc.yml @@ -3,19 +3,15 @@ href: ../index.md - name: Getting Started href: getting-started.md - - name: NetPlus Modules - - name: Algorithms - href: ../index.md - - - name: Converters - href: ../index.md - - - name: Generators - href: ../index.md - - - name: Validations - href: ../index.md - - - name: Service Abstractions - href: ../index.md + items: + - name: Algorithms + href: ../index.md + - name: Converters + href: ../index.md + - name: Generators + href: ../index.md + - name: Validations + href: ../index.md + - name: Service Abstractions + href: ../index.md From 1c92855c6952873f0730144604577810a55a85da Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Sat, 24 Feb 2024 00:07:39 -0300 Subject: [PATCH 18/33] Update toc.yml --- docs/docs/toc.yml | 84 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 74 insertions(+), 10 deletions(-) diff --git a/docs/docs/toc.yml b/docs/docs/toc.yml index 33a52f0..cb5dfac 100644 --- a/docs/docs/toc.yml +++ b/docs/docs/toc.yml @@ -1,17 +1,81 @@ - name: Get started + - name: Introduction href: ../index.md - name: Getting Started href: getting-started.md + - name: NetPlus Modules + +- name: Algorithms items: - - name: Algorithms - href: ../index.md - - name: Converters - href: ../index.md - - name: Generators - href: ../index.md - - name: Validations - href: ../index.md - - name: Service Abstractions - href: ../index.md + - name: Comparison + items: + - name: CosineSimilarity + href: ../index.md + + - name: JaccardSimilarity + href: ../index.md + + - name: JansenShannonSimilarity + href: ../index.md + + - name: JaroWinklerSimilarity + href: ../index.md + + - name: LevenshteinSimilarity + href: ../index.md + + - name: NGramSimilarity + href: ../index.md + + - name: Graphs + items: + - name: BreadthFirstSearch + href: ../index.md + + - name: DepthFirstSearch + href: ../index.md + + - name: Search + items: + - name: AStarSearch + href: ../index.md + + - name: BinarySearch + href: ../index.md + + - name: FibonacciSearch + href: ../index.md + + - name: InterpolatedSearch + href: ../index.md + + - name: JumpSearch + href: ../index.md + + - name: TernarySearch + href: ../index.md + + - name: Sorting + items: + - name: BubbleSort + href: ../index.md + + - name: HeapSort + href: ../index.md + + - name: MergeSort + href: ../index.md + + - name: SelectionSort + href: ../index.md + +- name: Converters + href: ../index.md +- name: Generators + href: ../index.md +- name: Validations + href: ../index.md +- name: Service Abstractions + href: ../index.md From 42682b0de1f92c7c6cdf27e3033bf4f20b3900d5 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Sat, 24 Feb 2024 00:10:29 -0300 Subject: [PATCH 19/33] Update toc.yml --- docs/docs/toc.yml | 112 +++++++++++++++++++++++----------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/docs/docs/toc.yml b/docs/docs/toc.yml index cb5dfac..2692710 100644 --- a/docs/docs/toc.yml +++ b/docs/docs/toc.yml @@ -6,70 +6,70 @@ href: getting-started.md - name: NetPlus Modules - -- name: Algorithms items: - - name: Comparison + - name: Algorithms items: - - name: CosineSimilarity - href: ../index.md + - name: Comparison + items: + - name: CosineSimilarity + href: ../index.md + + - name: JaccardSimilarity + href: ../index.md + + - name: JansenShannonSimilarity + href: ../index.md + + - name: JaroWinklerSimilarity + href: ../index.md + + - name: LevenshteinSimilarity + href: ../index.md + + - name: NGramSimilarity + href: ../index.md - - name: JaccardSimilarity + - name: Graphs + items: + - name: BreadthFirstSearch href: ../index.md - - - name: JansenShannonSimilarity + + - name: DepthFirstSearch href: ../index.md - - - name: JaroWinklerSimilarity + + - name: Search + items: + - name: AStarSearch href: ../index.md - - - name: LevenshteinSimilarity + + - name: BinarySearch href: ../index.md - - - name: NGramSimilarity + + - name: FibonacciSearch + href: ../index.md + + - name: InterpolatedSearch + href: ../index.md + + - name: JumpSearch + href: ../index.md + + - name: TernarySearch + href: ../index.md + + - name: Sorting + items: + - name: BubbleSort + href: ../index.md + + - name: HeapSort + href: ../index.md + + - name: MergeSort + href: ../index.md + + - name: SelectionSort href: ../index.md - - - name: Graphs - items: - - name: BreadthFirstSearch - href: ../index.md - - - name: DepthFirstSearch - href: ../index.md - - - name: Search - items: - - name: AStarSearch - href: ../index.md - - - name: BinarySearch - href: ../index.md - - - name: FibonacciSearch - href: ../index.md - - - name: InterpolatedSearch - href: ../index.md - - - name: JumpSearch - href: ../index.md - - - name: TernarySearch - href: ../index.md - - - name: Sorting - items: - - name: BubbleSort - href: ../index.md - - - name: HeapSort - href: ../index.md - - - name: MergeSort - href: ../index.md - - - name: SelectionSort - href: ../index.md - name: Converters href: ../index.md From 48f38eb436be98f9a816059d08ae41d387f8c513 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Sat, 24 Feb 2024 00:14:53 -0300 Subject: [PATCH 20/33] Update toc.yml --- docs/docs/toc.yml | 49 ++++++++++++++--------------------------------- 1 file changed, 14 insertions(+), 35 deletions(-) diff --git a/docs/docs/toc.yml b/docs/docs/toc.yml index 2692710..2c5adb5 100644 --- a/docs/docs/toc.yml +++ b/docs/docs/toc.yml @@ -1,76 +1,55 @@ - name: Get started - - name: Introduction href: ../index.md - name: Getting Started href: getting-started.md - - name: NetPlus Modules +- name: Algorithms items: - - name: Algorithms + - name: Comparison items: - - name: Comparison - items: - - name: CosineSimilarity - href: ../index.md - - - name: JaccardSimilarity - href: ../index.md - - - name: JansenShannonSimilarity - href: ../index.md - - - name: JaroWinklerSimilarity - href: ../index.md - - - name: LevenshteinSimilarity - href: ../index.md - - - name: NGramSimilarity - href: ../index.md - + - name: CosineSimilarity + href: ../index.md + - name: JaccardSimilarity + href: ../index.md + - name: JansenShannonSimilarity + href: ../index.md + - name: JaroWinklerSimilarity + href: ../index.md + - name: LevenshteinSimilarity + href: ../index.md + - name: NGramSimilarity + href: ../index.md - name: Graphs items: - name: BreadthFirstSearch href: ../index.md - - name: DepthFirstSearch href: ../index.md - - name: Search items: - name: AStarSearch href: ../index.md - - name: BinarySearch href: ../index.md - - name: FibonacciSearch href: ../index.md - - name: InterpolatedSearch href: ../index.md - - name: JumpSearch href: ../index.md - - name: TernarySearch href: ../index.md - - name: Sorting items: - name: BubbleSort href: ../index.md - - name: HeapSort href: ../index.md - - name: MergeSort href: ../index.md - - name: SelectionSort href: ../index.md - - name: Converters href: ../index.md - name: Generators From 81feab196c7e549b7cb9a4dc988882aadfe1f398 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Sat, 24 Feb 2024 00:29:22 -0300 Subject: [PATCH 21/33] Update toc.yml --- docs/docs/toc.yml | 69 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 64 insertions(+), 5 deletions(-) diff --git a/docs/docs/toc.yml b/docs/docs/toc.yml index 2c5adb5..b94e81d 100644 --- a/docs/docs/toc.yml +++ b/docs/docs/toc.yml @@ -50,11 +50,70 @@ href: ../index.md - name: SelectionSort href: ../index.md + - name: Converters - href: ../index.md + items: + - name: Date + items: + - name: DateTimeConverter + href: ../index.md + + - name: Temperature + items: + - name: TemperatureConverter + href: ../index.md + - name: Generators - href: ../index.md -- name: Validations - href: ../index.md + items: + - name: GenericGenerator + items: + - name: DataGenerator + href: ../index.md + + - name: GuidGenerator + items: + - name: GuidGenerator + href: ../index.md + + - name: PasswordGenerator + items: + - name: PasswordGenerator + href: ../index.md + +- name: Validators + items: + - name: Date + items: + - name: DateValidator + href: ../index.md + + - name: Numeric + items: + - name: NumericValidator + href: ../index.md + + - name: RegexExtensions + items: + - name: StringValidator + href: ../index.md + - name: Service Abstractions - href: ../index.md + items: + - name: Cache + items: + - name: Redis + href: ../index.md + - name: Memory + href: ../index.md + + - name: Database + items: + - name: NoSQL + items: + - name: MongoDB + - href: ../index.md + + - name: SQL + items: + - name: SQLServer + - href: ../index.md From 9cea7af642a9a6074e1c9597b418806a10fdb900 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Sat, 24 Feb 2024 00:33:53 -0300 Subject: [PATCH 22/33] Update toc.yml --- docs/docs/toc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/toc.yml b/docs/docs/toc.yml index b94e81d..0b98cea 100644 --- a/docs/docs/toc.yml +++ b/docs/docs/toc.yml @@ -111,9 +111,9 @@ - name: NoSQL items: - name: MongoDB - - href: ../index.md + href: ../index.md - name: SQL items: - name: SQLServer - - href: ../index.md + href: ../index.md From 0b8ce227620b29779dece178f992fdb747eb01ef Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Sat, 24 Feb 2024 00:43:32 -0300 Subject: [PATCH 23/33] Create bubblesort.md --- docs/docs/algorithms/sorting/bubblesort.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/docs/algorithms/sorting/bubblesort.md diff --git a/docs/docs/algorithms/sorting/bubblesort.md b/docs/docs/algorithms/sorting/bubblesort.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/docs/docs/algorithms/sorting/bubblesort.md @@ -0,0 +1 @@ + From e3a7980c7868d932b629effa500ea7781a97d7b7 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Sat, 24 Feb 2024 00:50:36 -0300 Subject: [PATCH 24/33] Update bubblesort.md --- docs/docs/algorithms/sorting/bubblesort.md | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/docs/docs/algorithms/sorting/bubblesort.md b/docs/docs/algorithms/sorting/bubblesort.md index 8b13789..5e37a5e 100644 --- a/docs/docs/algorithms/sorting/bubblesort.md +++ b/docs/docs/algorithms/sorting/bubblesort.md @@ -1 +1,49 @@ +# BubbleSort Class +Provides methods for performing Bubble Sort on arrays. + +## BubbleSort Class Members + +```csharp +ExecuteBubbleSort(this T[] array) where T : IComparable +``` + +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. From 04fed5c12e2192169a722e55d4ab22575dbc228d Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Sat, 24 Feb 2024 00:51:26 -0300 Subject: [PATCH 25/33] Update toc.yml --- docs/docs/toc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/toc.yml b/docs/docs/toc.yml index 0b98cea..ff3b569 100644 --- a/docs/docs/toc.yml +++ b/docs/docs/toc.yml @@ -43,7 +43,7 @@ - name: Sorting items: - name: BubbleSort - href: ../index.md + href: algorithms/sorting/bubblesort.md - name: HeapSort href: ../index.md - name: MergeSort From 580afe7ea8fb71859866a45b2e6a35c8d1083f70 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Sat, 24 Feb 2024 01:00:43 -0300 Subject: [PATCH 26/33] Update bubblesort.md --- docs/docs/algorithms/sorting/bubblesort.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/docs/algorithms/sorting/bubblesort.md b/docs/docs/algorithms/sorting/bubblesort.md index 5e37a5e..68fa91f 100644 --- a/docs/docs/algorithms/sorting/bubblesort.md +++ b/docs/docs/algorithms/sorting/bubblesort.md @@ -10,16 +10,16 @@ ExecuteBubbleSort(this T[] array) where T : IComparable Sorts an array using the Bubble Sort algorithm in ascending order. -#### Parameters +## Parameters - `array` (Type: `T[]`): The array to be sorted. -#### Returns +## Returns - Type: `T[]` - Description: The sorted array in ascending order. -#### Example +## Example ```csharp using NetPlus.Algorithms.Sorting; @@ -34,7 +34,7 @@ var sortedArray = myArray.ExecuteBubbleSort(); Console.WriteLine(string.Join(", ", sortedArray)); ``` -#### Usage +## Usage To use the BubbleSort class, simply call the ExecuteBubbleSort method on your array. @@ -43,7 +43,7 @@ int[] myArray = { 4, 2, 7, 1, 9 }; var sortedArray = BubbleSort.ExecuteBubbleSort(myArray); ``` -#### Remarks +## Remarks The BubbleSort class uses the Bubble Sort algorithm to sort arrays in ascending order. It is an in-place sorting algorithm. From 34741ae8d3ad7c4c2732142505d32b6348f33ada Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Sat, 24 Feb 2024 01:16:22 -0300 Subject: [PATCH 27/33] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/custom.md | 10 ++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/custom.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..dd84ea7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -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. diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md new file mode 100644 index 0000000..48d5f81 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/custom.md @@ -0,0 +1,10 @@ +--- +name: Custom issue template +about: Describe this issue template's purpose here. +title: '' +labels: '' +assignees: '' + +--- + + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -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. From 24d49172c9a383523e8a4ba6b83717f3ae8e08c0 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Sat, 24 Feb 2024 14:53:52 -0300 Subject: [PATCH 28/33] Create heapsort.md --- docs/docs/algorithms/sorting/heapsort.md | 48 ++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 docs/docs/algorithms/sorting/heapsort.md diff --git a/docs/docs/algorithms/sorting/heapsort.md b/docs/docs/algorithms/sorting/heapsort.md new file mode 100644 index 0000000..1793496 --- /dev/null +++ b/docs/docs/algorithms/sorting/heapsort.md @@ -0,0 +1,48 @@ +# HeapSort Class + +**Provides methods for performing Heap Sort on arrays.** + +## HeapSort Class Members + +```csharp +Sort(this T[] array) where T : IComparable +``` + +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. From 95909e699ee4adf415ac10194b2d70da04a7d9a8 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Sat, 24 Feb 2024 15:02:31 -0300 Subject: [PATCH 29/33] Create mergesort.md --- docs/docs/algorithms/sorting/mergesort.md | 117 ++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 docs/docs/algorithms/sorting/mergesort.md diff --git a/docs/docs/algorithms/sorting/mergesort.md b/docs/docs/algorithms/sorting/mergesort.md new file mode 100644 index 0000000..b7cf76b --- /dev/null +++ b/docs/docs/algorithms/sorting/mergesort.md @@ -0,0 +1,117 @@ +# MergeSort Class + +**Provides methods for performing Merge Sort on arrays.** + +## MergeSort Class Members + +```csharp +ExecuteMergeSort( + this T[] array, + SortOrder sortOrder = SortOrder.Ascending, + IComparer? comparer = null) +``` + +Sorts an array using the Merge Sort algorithm. + +## Parameters + +- `array` (Type: `T[]`): The array to be sorted. +- `sortOrder` (Type: `SortOrder`, Default: `Ascending`): The order in which to sort the array (ascending or descending). +- `comparer` (Type: `IComparer?`, Default: `null`): The comparer to use for custom element comparisons. + +## Returns + +- Type: `T[]` +- Description: The sorted array. + +## Example + +```csharp +using NetPlus.Algorithms.Sorting; + +// Example array of custom objects +Person[] peopleArray = +{ + new Person("John", 30), + new Person("Alice", 25), + new Person("Bob", 35), + new Person("Eve", 28) +}; + +// Custom comparer for sorting Person objects by age +IComparer customComparer = new PersonAgeComparer(); + +// Sorting the array of Person objects using Merge Sort with custom comparer +var sortedPeopleArray = peopleArray.ExecuteMergeSort(SortOrder.Ascending, customComparer); + +// Displaying the sorted array of Person objects +foreach (var person in sortedPeopleArray) +{ + Console.WriteLine($"Name: {person.Name}, Age: {person.Age}"); +} +``` + +## Usage + +To use the MergeSort class, simply call the `ExecuteMergeSort` method on your array. + +```csharp +int[] myArray = { 4, 2, 7, 1, 9 }; +var sortedArray = MergeSort.ExecuteMergeSort(myArray); +``` + +## Remarks + +The `MergeSort` class uses the Merge Sort algorithm to sort arrays. It supports both ascending and descending order sorting, along with custom comparers. + +```csharp +IComparer customComparer = /* your custom comparer */; +var sortedArray = myArray.ExecuteMergeSort(SortOrder.Descending, customComparer); +``` + +## IComparer Usage in MergeSort + +The `MergeSort` class utilizes the `IComparer` interface to provide flexibility in customizing the sorting logic. The `ExecuteMergeSort` method allows you to pass an optional `IComparer` implementation for comparing elements during the sorting process. + +### Using IComparer with MergeSort + +```csharp +using NetPlus.Algorithms.Sorting; + +// Example array of custom objects +Person[] peopleArray = +{ + new Person("John", 30), + new Person("Alice", 25), + new Person("Bob", 35), + new Person("Eve", 28) +}; + +// Custom comparer for sorting Person objects by age +IComparer customComparer = new PersonAgeComparer(); + +// Sorting the array of Person objects using Merge Sort with custom comparer +var sortedPeopleArray = peopleArray.ExecuteMergeSort(SortOrder.Ascending, customComparer); + +// Displaying the sorted array of Person objects +foreach (var person in sortedPeopleArray) +{ + Console.WriteLine($"Name: {person.Name}, Age: {person.Age}"); +} +``` + +### Custom IComparer Implementation + +```csharp +public class PersonAgeComparer : IComparer +{ + public int Compare(Person x, Person y) + { + return x.Age.CompareTo(y.Age); + } +} +``` + +The `PersonAgeComparer` class compares `Person` objects based on their age property. You can create similar custom comparers to tailor the sorting logic according to your specific requirements. + +By leveraging the `IComparer` interface, the `MergeSort` class provides a way to incorporate custom comparisons while maintaining the efficiency of the Merge Sort algorithm. This enables you to apply different sorting criteria to various types of objects within the same sorting algorithm. From bfd5a8a5eba3df5e4f5629dabad38dd9efc46de6 Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Sat, 24 Feb 2024 15:08:57 -0300 Subject: [PATCH 30/33] Create selectionsort.md --- docs/docs/algorithms/sorting/selectionsort.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 docs/docs/algorithms/sorting/selectionsort.md diff --git a/docs/docs/algorithms/sorting/selectionsort.md b/docs/docs/algorithms/sorting/selectionsort.md new file mode 100644 index 0000000..ee14073 --- /dev/null +++ b/docs/docs/algorithms/sorting/selectionsort.md @@ -0,0 +1,66 @@ +# SelectionSort Class + +**Provides methods for performing Selection Sort on arrays.** + +## SelectionSort Class Members + +```csharp +ExecuteSelectionSort(this T[] array) where T : IComparable +``` + +Sorts an array using the Selection 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 Selection Sort +var sortedArray = myArray.ExecuteSelectionSort(); + +// Displaying the sorted array +Console.WriteLine(string.Join(", ", sortedArray)); +``` + +## Usage + +To use the SelectionSort class, simply call the `ExecuteSelectionSort` method on your array. + +```csharp +int[] myArray = { 4, 2, 7, 1, 9 }; +var sortedArray = SelectionSort.ExecuteSelectionSort(myArray); +``` + +## Remarks + +The `SelectionSort` class uses the Selection Sort algorithm to sort arrays in ascending order. It is an in-place sorting algorithm. + +```csharp +// Example of sorting custom objects +Person[] peopleArray = +{ + new Person("John", 30), + new Person("Alice", 25), + new Person("Bob", 35), + new Person("Eve", 28) +}; + +// Sorting the array of Person objects using Selection Sort +var sortedPeopleArray = peopleArray.ExecuteSelectionSort(); +``` + +In the above example, the `ExecuteSelectionSort` method is used to sort an array of custom objects (`Person`) based on their natural order. + +Note: The type `T` must implement the `IComparable` interface for the sorting to work. From 96352eb221e14e4b32e1ac1b6b339957e71aebee Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Sat, 24 Feb 2024 15:13:52 -0300 Subject: [PATCH 31/33] Create astarsearch.md --- docs/docs/algorithms/search/astarsearch.md | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 docs/docs/algorithms/search/astarsearch.md diff --git a/docs/docs/algorithms/search/astarsearch.md b/docs/docs/algorithms/search/astarsearch.md new file mode 100644 index 0000000..6b240e5 --- /dev/null +++ b/docs/docs/algorithms/search/astarsearch.md @@ -0,0 +1,84 @@ +# AStarSearch Class + +**A* Search algorithm implementation for finding the shortest path in a weighted graph.** + +## AStarSearch Class Members + +```csharp +SearchAStar( + Dictionary> graph, + T start, + T goal, + Func heuristic) +``` + +Performs A* search on a weighted graph to find the shortest path from the start to the goal. + +## Parameters + +- `graph` (Type: `Dictionary>`): The weighted graph represented as a dictionary. +- `start` (Type: `T`): The starting node. +- `goal` (Type: `T`): The goal node. +- `heuristic` (Type: `Func`): Heuristic function estimating the cost from a node to the goal. + +## Returns + +- Type: `List` +- 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> +{ + { 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 euclideanHeuristic = (node, goal) => +{ + // Implement your heuristic function here + return Math.Abs(node - goal); +}; + +// Performing A* search +var shortestPath = AStarSearch.SearchAStar(weightedGraph, 0, 5, euclideanHeuristic); + +// Displaying the shortest path +Console.WriteLine(string.Join(" -> ", shortestPath)); +``` + +## Usage + +To use the AStarSearch class, simply call the `SearchAStar` method with the appropriate parameters. + +```csharp +// Example usage +var shortestPath = AStarSearch.SearchAStar(weightedGraph, startNode, goalNode, heuristicFunction); +``` + +## Remarks + +The `AStarSearch` 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 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.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. From c925e184771d8a02e6e51a765fdce4977bde82ce Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Sat, 24 Feb 2024 15:15:29 -0300 Subject: [PATCH 32/33] Create binarysearch.md --- docs/docs/algorithms/search/binarysearch.md | 55 +++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 docs/docs/algorithms/search/binarysearch.md diff --git a/docs/docs/algorithms/search/binarysearch.md b/docs/docs/algorithms/search/binarysearch.md new file mode 100644 index 0000000..6a51ac2 --- /dev/null +++ b/docs/docs/algorithms/search/binarysearch.md @@ -0,0 +1,55 @@ +# BinarySearch Class + +**A static class containing the implementation of Binary Search algorithm.** + +## BinarySearch Class Members + +```csharp +SearchBinary(this T[] array, T value) where T : IComparable +``` + +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); +``` From 43ec5c02cf4dbdd25dc367fb4c6d8378837f9ebb Mon Sep 17 00:00:00 2001 From: Guilherme Martin Date: Sat, 24 Feb 2024 15:22:16 -0300 Subject: [PATCH 33/33] Update toc.yml --- docs/docs/toc.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/docs/toc.yml b/docs/docs/toc.yml index ff3b569..c5be469 100644 --- a/docs/docs/toc.yml +++ b/docs/docs/toc.yml @@ -29,9 +29,9 @@ - name: Search items: - name: AStarSearch - href: ../index.md + href: algorithms/search/astarsearch.md - name: BinarySearch - href: ../index.md + href: algorithms/search/binarysearch.md - name: FibonacciSearch href: ../index.md - name: InterpolatedSearch @@ -45,11 +45,11 @@ - name: BubbleSort href: algorithms/sorting/bubblesort.md - name: HeapSort - href: ../index.md + href: algorithms/sorting/heapsort.md - name: MergeSort - href: ../index.md + href: algorithms/sorting/mergesort.md - name: SelectionSort - href: ../index.md + href: algorithms/sorting/selectionsort.md - name: Converters items: