Commit Graph

1746 Commits

Author SHA1 Message Date
Kanav Goyal
145111cd7e feat: implement optimized two-pointer approach for trapping rainwater (#2975) (#2976)
* feat: optimize trapping rainwater

* incorporate changes

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2025-08-15 09:24:59 +00:00
realstealthninja
79aeaa9b52 chore: try to comply to C++20 (#2978)
* chroe: add cstdint

* fix: remove <> from explicit function
2025-08-15 05:24:35 +00:00
Piotr Idzik
e9caade55e chore: sort subdirectories (#2949)
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2025-08-15 04:45:42 +00:00
Piotr Idzik
6568ab983d style: resolve -Wreorder (#2950)
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2025-08-15 04:40:28 +00:00
Jonas Vautherin
13306be79f Fixed name space problem by removing using namespace std (#2966)
Co-authored-by: FuelTheBurn <richarddasunboss@gmail.com>
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2025-08-15 04:05:18 +00:00
Piotr Idzik
fb27d4d304 style: remove unused params of main (#2948)
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2025-08-15 03:52:28 +00:00
Piotr Idzik
d4962c3032 style: remove unused variables (#2946)
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2025-08-14 04:27:18 +00:00
Piotr Idzik
3f0409d7cc style: remove unused array includes (#2947) 2025-08-14 01:44:21 +00:00
pipinstallaadit
f1eddf4d65 Couple of issues and areas for improvement. (#2841)
1. Typographical Error in Doxygen Comment

In the Doxygen comment at the beginning of the file, "Merege Sort" should be corrected to "Merge Sort".

2. Merging Logic

In the merge function, the merging logic can lead to out-of-bounds access if both sub-arrays have been completely traversed. The condition in the while loop should ensure that you only access elements of L and R if they are within bounds:

3. Memory Management

Using new and delete[] for the temporary arrays (L and R) is fine, but you can also use std::vector from the C++ Standard Library to simplify memory management:

4. Input Validation

You should consider adding input validation when reading the number of elements and the actual elements to avoid undefined behavior.

5. Main Function Improvements

You can also enhance the main function by encapsulating the input logic in a separate function, improving readability.

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2025-07-09 10:51:02 +00:00
Piotr Idzik
93a700c7e9 style: remove unused vector includes (#2945) 2025-05-25 19:53:06 +05:30
jiya
da53b26bde docs: add time and space complexity to quick_sort.cpp (#2819)
* Complexity quick_sort.cpp

Space Complexity
Time complexity

* Update sorting/quick_sort.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update sorting/quick_sort.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2025-05-19 14:22:44 +00:00
jiya
3f6876f03f Update merge_sort.cpp (#2818)
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2025-05-19 11:43:50 +00:00
realstealthninja
c26eea874d Revert "chore: use annotations instead of in house linter (#2905)" (#2944)
This reverts commit 41653de718.
2025-05-19 11:36:54 +00:00
Shi Entong
77b9f39d96 docs, tests, fix: fit fibonacci_fast to contributing guidelines (#2893)
* Update fibonacci_fast.cpp

Modify the fibonacci_fast.cpp to fit the project style requirements.

* Update fibonacci_fast.cpp to meet the revision suggestions.

* Update fibonacci_fast.cpp to try to pass some CI test

* Update fibonacci_fast.cpp

* Update fibonacci_fast.cpp to meet the coding style requirements

* Update fibonacci_fast.cpp

* Update fibonacci_fast.cpp

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-11-24 20:30:01 +05:30
realstealthninja
c851590944 fix: workflow issue in awesome workflow (#2908) 2024-11-24 19:42:02 +05:30
realstealthninja
d1bb156a68 chore: fix permission issues in cpp-linter (#2907)
* ci: make compile add warnings to file

* chore: use cpp-linter instead of inhouse linter

* chore: use abinoda instead of pullreminders for label-when-approved

* fix: permissions awesome-ci

* fix: permission issue for github action
2024-11-24 13:33:07 +05:30
realstealthninja
06d195f7aa fix: permissions in github actions (#2906)
* ci: make compile add warnings to file

* chore: use cpp-linter instead of inhouse linter

* chore: use abinoda instead of pullreminders for label-when-approved

* fix: permissions awesome-ci
2024-11-24 13:24:38 +05:30
realstealthninja
41653de718 chore: use annotations instead of in house linter (#2905)
* ci: make compile add warnings to file

* chore: use cpp-linter instead of inhouse linter

* chore: use abinoda instead of pullreminders for label-when-approved
2024-11-24 13:14:42 +05:30
Henrique GC
94202ec13f fix: incorrect exception handling in factorial function (#2868)
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-11-24 13:08:30 +05:30
jasonjyu
769b3c71c1 Added to z_function test corner cases for empty text and pattern (#2863)
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-11-17 09:39:59 +05:30
github-actions[bot]
acb9ac2f2d docs: update DIRECTORY.md (#2899)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-11-17 07:50:52 +05:30
DoGoodCoder
48743d3f3d feat: add non-preemptive SJF scheduling (#2801)
* Create non_preemptive_sjf_scheduling.cpp

* Update non_preemptive_sjf_scheduling.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update non_preemptive_sjf_scheduling.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update non_preemptive_sjf_scheduling.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* added a vector to store and print the final result

* Update non_preemptive_sjf_scheduling.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update non_preemptive_sjf_scheduling.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Create non_preemptive_sjf_scheduling.cpp

I have done the necessary changes.
The test function will generate 10 different testcases in which it will print  the before and after the SJF scheduling.

@realstealthninja Kindly review the PR and please accept it.

* Delete non_preemptive_sjf_scheduling.cpp

* Update cpu_scheduling_algorithms/non_preemptive_sjf_scheduling.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update non_preemptive_sjf_scheduling.cpp

* Update non_preemptive_sjf_scheduling.cpp

* Update cpu_scheduling_algorithms/non_preemptive_sjf_scheduling.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update non_preemptive_sjf_scheduling.cpp

* Update non_preemptive_sjf_scheduling.cpp

* clang-format and clang-tidy fixes for 57e670c2

* chore: remove spaces

* Update dynamic_programming/unbounded_0_1_knapsack.cpp

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-11-07 05:44:48 +05:30
github-actions[bot]
34e7231b88 docs: update DIRECTORY.md (#2898)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-11-06 21:40:38 +05:30
realstealthninja
8b1eab204b doc: Use the doxygen awesome theme (#2807)
* chore: remove cppreference

* feat: add doxyfile

* feat: add doxygen-awesome theme

* chore: remove unneccessary doxygen config form cmake

* test: for doxygen test purposes

Note: revert before merging to main

* fix: try removing css from rm

* fix: set style sheet via cmake

* feat: make doxygen theme finally work

* fix: remove mathjax from doxyfile

* feat: add  sidebar and make mathjax work

* doc: add transparency and make output svg of dot

* fix: make dots interactive

* chore: move math jax from cmake to doxyfile

* feat: add header file

* chore: add header file to cmake

* chore: remove redundant transparency config

* fix: force cmake to use config file

* chore: remove working directory

* fix: use old add_docs command

* feat: fix doxygen build

* fix: re enable clang assited parsing

* fix: use relative paths

* fix: relative paths arent necessary

* feat: add project logo and favicon

* fix: revert gh-pages to master

* fix: add dot to doxyfile

* fix: add lib clang to doxygen

* fix: use source browser

* fix: add clang as compiler

* docs: remove headers from source browser

* revert: branch to master
2024-11-04 18:11:14 +05:30
realstealthninja
0d766b0f8a feat: update to CXX standard 17 and add CMakeLists file to directories without them (#2746)
* chore: add cache and build comment to git ignore

* fix: add cmakelists to dynamic programming

* fix: add cmakelists to greedy_algorithms

* fix: add cmakelists to operations_on_datastructures

* fix: add cmakelists to range_queries

* fix: add `dynamic_programmin`, `greedy_algorithms`, `range_queries` and `operations_on_datastructures` subdirectories to cmakelists.txt

* fix: init of transform_reduce in dynamic_programming

* fix: add an include for functional in catalan_numbers

* chore: bump CXX standard to 20

* revert: bump CXX standard to 20

* chore: bump c++ version to 17 and add justification

Arm supports c++ 17
Esp32 supports c++ 23
decision was made to be 17 because it seemed to offer the best combatability

* fix: compilation error in catalan numbers

* fix: add <set> header to longest increasing subsequence nlogn

* fix: add cmath & algorithm header to mo.cpp

* fix: remove register key word from fast integer

* fix: replace using namespace std with std::cin and std::cout

* docs: typo in c++17

* fix: memory leak in bellman_ford

* fix: typo in bellman_ford

* fix: typo in word_break

* fix: dynamic array in coin_change

* fix dynamic array in egg_dropping puzzle

* chore: remove unnecessary comment

* fix: add vla to be an error

* chore: add extra warnings

* fix: use add_compile options instead of set()

* fix: compile options are not strings

* fix: vla in floyd_warshall

* fix: vla in egg_dropping_puzzel

* fix: vla in coin_change

* fix: vla in edit_distance

* fix: vla in floyd_warshall

* feat: remove kadane and replace it with kadane2

* fix: vla in longest_common_subsequence

* fix: int overflow in floyd_warshall

* fix: vla in lisnlogn

* fix: use const vector& instead of array

* fix: use dynamic array instead of vla in knapsack

* fix: use of and in msvc is unsupported by default adding permissive flag fixes it

* test: make executables the tests themselves

* Revert "test: make executables the tests themselves"

This reverts commit 7a16c31c4e.

* fix: make dist constant in print

* fix: namespace issue in unbounded_0_1

* fix: include cstdint to fix compilation
2024-11-04 18:00:20 +05:30
realstealthninja
c6af943508 fix: add cstdint header to all files using fixed width integers (#2717)
* fix: add <cstdint> to subset_sum.cpp

* fix: add <cstdint> to subarray_sum.cpp

* fix: add <cstdint> to wildcard_matching.cpp

* fix: add <cstdint> to count_bit_flips.cpp

* fix: add <cstdint> to count_of_set_bits.cpp

* fix: add <cstdint> to trailing_ciphers.cpp

* fix: add <cstdint> to hamming_distance.cpp

* doc: include doc for hamming_distance

* fix: add <cstdint> to next_higher_numebr_with_same_number_of_set_bits.cpp

* fix: add <cstdint> to power_of_2.cpp

* fix: add <cstdint> to set_kth_bit.cpp

* fix: add <cstdint> to bit_manipulation/set_kth_bit.cpp

* fix: add <cstdint> to bit_manipulation/travelling_salesman_using_bit_manipulation.cpp

* fix: add <cstdint> to ciphers/base64_encoding.cpp

* fix: add <cstdint> to ciphers/hill_cipher.cpp

* fix: add <cstdint> to ciphers/uint128_t.hpp

* fix: add <cstdint> to data_structures/dsu_path_compression.cpp

* fix: add <cstdint> to data_structures/dsu_path_compression.cpp

* fix add <cstdint> to datastructures/list_array>cpp

* fix add <cstdint> to datastructures/queue_using_array.cpp

* fix: add <cstdint> to sparse_table.cpp

* fix: add <cstdint> to stack_using_list_queue.cpp

* fix: add <cstdint> to treap.cpp

* fix: add <cstdint> to graham_scan_functions.hpp

* fix: add <cstdint> to graph/**

* fix: add integral typdefs to hashing/**

* fix: add <cstdint> to math/**

* fix: add <cstdint> to numerical_methods/**

* fix: add <cstdint> to other/**

* fix: add <cstdint> to search/**

* fix: add <cstdint> to sorting/**

* fix: add <cstdint> to string/**

* doc: remove include statement from comment

* fix: make tests static

Co-authored-by: David Leal <halfpacho@gmail.com>

* fix: make tests static

Co-authored-by: David Leal <halfpacho@gmail.com>

* chore: use iwyu on backtracking/**.cpp

* chore: use iwyu on bit_manip/**.cpp

* chore: use iwyu on ciphers/**.cpp

* chore: use iwyu on cpu_scheduling_algorithms/**.cpp

* chore: use iwyu on data_structures/**.cpp

* chore: use iwyu on divide_and_conquer/**.cpp

* chore: use iwyu on geometry/**.cpp

* chore: use iwyu on graph/**.cpp

* chore: use iwyu on hashing/**.cpp

* chore: use iwyu on machine_learning/**.cpp

* chore: use iwyu on math/**.cpp

* chore: use iwyu on numerical_methods/**.cpp

* chore: use iwyu on others/**.cpp

* chore: use iwyu on probablity/**.cpp

* chore: use iwyu on search/**.cpp

* chore: use iwyu on sorting/**.cpp

* chore: use iwyu on strings/**.cpp

* Revert "chore: use iwyu on strings/**.cpp"

This reverts commit f2127456a8.

* Revert "chore: use iwyu on sorting/**.cpp"

This reverts commit a290ae7ee2.

* Revert "chore: use iwyu on search/**.cpp"

This reverts commit 19d136ae0f.

* Revert "chore: use iwyu on probablity/**.cpp"

This reverts commit 5dd7f82a34.

* Revert "chore: use iwyu on others/**.cpp"

This reverts commit 8a8fd42383.

* Revert "chore: use iwyu on numerical_methods/**.cpp"

This reverts commit eff2f44a50.

* Revert "chore: use iwyu on math/**.cpp"

This reverts commit c47117ca3f.

* Revert "chore: use iwyu on machine_learning/**.cpp"

This reverts commit c3897d3763.

* Revert "chore: use iwyu on hashing/**.cpp"

This reverts commit 0c6611a835.

* Revert "chore: use iwyu on graph/**.cpp"

This reverts commit dabd6d2591.

* Revert "chore: use iwyu on geometry/**.cpp"

This reverts commit 740bd65932.

* Revert "chore: use iwyu on divide_and_conquer/**.cpp"

This reverts commit 16ee49e086.

* Revert "chore: use iwyu on data_structures/**.cpp"

This reverts commit a3b719e368.

* Revert "chore: use iwyu on cpu_scheduling_algorithms/**.cpp"

This reverts commit 24e597f7e2.

* Revert "chore: use iwyu on ciphers/**.cpp"

This reverts commit 3d80295883.

* Revert "chore: use iwyu on bit_manip/**.cpp"

This reverts commit 7edcb6e458.

* Revert "chore: use iwyu on backtracking/**.cpp"

This reverts commit f0a30d7cdb.

* Update search/binary_search.cpp

* Update backtracking/subarray_sum.cpp

* Update backtracking/subset_sum.cpp

* Update backtracking/wildcard_matching.cpp

* Update bit_manipulation/count_bits_flip.cpp

* Update bit_manipulation/count_of_set_bits.cpp

* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

* Update bit_manipulation/hamming_distance.cpp

* Update bit_manipulation/next_higher_number_with_same_number_of_set_bits.cpp

* Update bit_manipulation/power_of_2.cpp

* Update others/lru_cache.cpp

* Update bit_manipulation/set_kth_bit.cpp

* Update bit_manipulation/travelling_salesman_using_bit_manipulation.cpp

* Update ciphers/base64_encoding.cpp

* Update ciphers/hill_cipher.cpp

* Update ciphers/uint128_t.hpp

* Update cpu_scheduling_algorithms/fcfs_scheduling.cpp

* Update data_structures/dsu_path_compression.cpp

* Update data_structures/dsu_union_rank.cpp

* Update data_structures/list_array.cpp

* Update data_structures/queue_using_array.cpp

* Update data_structures/sparse_table.cpp

* Update data_structures/stack_using_queue.cpp

* Update data_structures/treap.cpp

* Update geometry/graham_scan_functions.hpp

* Update graph/bidirectional_dijkstra.cpp

* Update graph/connected_components_with_dsu.cpp

* Update graph/cycle_check_directed_graph.cpp

* Update graph/is_graph_bipartite2.cpp

* Update graph/travelling_salesman_problem.cpp

* Update hashing/md5.cpp

* Update hashing/sha1.cpp

* Update math/n_choose_r.cpp

* Update strings/z_function.cpp

* Update strings/manacher_algorithm.cpp

* Update sorting/wiggle_sort.cpp

* Update sorting/selection_sort_recursive.cpp

* Update sorting/selection_sort_iterative.cpp

* Update sorting/recursive_bubble_sort.cpp

* Update sorting/radix_sort2.cpp

* Update sorting/dnf_sort.cpp

* Update sorting/cycle_sort.cpp

* Update search/sublist_search.cpp

* Update search/saddleback_search.cpp

* Update search/interpolation_search.cpp

* Update search/floyd_cycle_detection_algo.cpp

* Update search/exponential_search.cpp

* Update search/exponential_search.cpp

* Update math/n_bonacci.cpp

* Update math/aliquot_sum.cpp

* Update math/check_factorial.cpp

* Update math/double_factorial.cpp

* Update math/eulers_totient_function.cpp

* Update math/factorial.cpp

* Update math/fibonacci.cpp

* Update math/fibonacci_matrix_exponentiation.cpp

* Update math/fibonacci_sum.cpp

* Update math/finding_number_of_digits_in_a_number.cpp

* chore: remove "/// for integral typedefs"

* chore: remove for integral typedefs from modular division

* fix: remove comment from include

* fix: add cstdint to gale shapely

---------

Co-authored-by: David Leal <halfpacho@gmail.com>
2024-11-04 17:38:54 +05:30
github-actions[bot]
9b1d7024af docs: update DIRECTORY.md (#2896)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-11-03 19:44:03 +05:30
github-actions[bot]
5fd64423de docs: updating DIRECTORY.md (#2875)
* docs: update DIRECTORY.md

* docs: update DIRECTORY.md

* clang-format and clang-tidy fixes for d0663990

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-11-02 23:30:26 +05:30
Harshil Shah
85d62bb80d docs, test: Fit Topological Sort algorithm to contributing guidelines (#2835)
* Modified docs,test of topological sort algorithm

* Update topological_sort.cpp

* Add class "Graph"

* Update graph/topological_sort.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Add namespace topological_sort

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-11-01 22:51:52 +05:30
Ritobroto Kalita
649a145234 docs, test: Fit Sieve of Eratosthenes to contributing guidelines (#2803)
* Update sieve_of_eratosthenes.cpp

* Update doc

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-29 22:38:49 +05:30
Sanskruti Pravin Yeole
db3f9d3406 Create Unbounded_knapsack.cpp (#2786)
* Create Unbounded_knapsack.cpp

* Update Unbounded_knapsack.cpp

Documentation done.

* Update dynamic_programming/Unbounded_knapsack.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update dynamic_programming/Unbounded_knapsack.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update dynamic_programming/Unbounded_knapsack.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update dynamic_programming/Unbounded_knapsack.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Delete dynamic_programming/Unbounded_knapsack.cpp

* Create Unbounded_0_1_Knapsack.cpp

* Update Unbounded_0_1_Knapsack.cpp

* Update Unbounded_0_1_Knapsack.cpp

* docs: add docs for main

* Update dynamic_programming/Unbounded_0_1_Knapsack.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update dynamic_programming/Unbounded_0_1_Knapsack.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update Unbounded_0_1_Knapsack.cpp

* Update Unbounded_0_1_Knapsack.cpp

* Update Unbounded_0_1_Knapsack.cpp

* Update dynamic_programming/Unbounded_0_1_Knapsack.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update Unbounded_0_1_Knapsack.cpp

* Update Unbounded_0_1_Knapsack.cpp

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-28 21:21:55 +05:30
Muhammad Junaid Khalid
ecb8a3388d feat: Added Binary Addition Algorithm (#2802)
* Digit Separation Algorithm added

* feat: Added namespace greedy_algoriithms

* "Updated digit separation code: added comments and docstrings, changed data types to std::int64_t, and reformatted code."

* feat: Made test function and removed extra whitespaces

* removed some more whitespaces

* Update greedy_algorithms/digit_separation.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* fix: terminate multiline comment

* Update greedy_algorithms/digit_separation.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update greedy_algorithms/digit_separation.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update greedy_algorithms/digit_separation.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update greedy_algorithms/digit_separation.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Corrected test function

* Update greedy_algorithms/digit_separation.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update greedy_algorithms/digit_separation.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* remove redundant declaration

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Corrected tests

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* file clang linted

* "Moved method implementations from outside to inside class definition"

* fowardOrder to forwardOrder on line 122

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Removed Class scope resolution form digitSeparationReverseOrder function

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Removed Class scope resolution form digitSeparationForwardOrderfunction

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* docs: documentation updated

* initial commit of Binary Addition

* "Formatting changes and whitespace adjustments in binary_addition.cpp"

* Documentation added

* fix: removed unnecessary whitespaces

* fix: Fixed the case of non binary strings

* clang linted

* docs: Documentation updated

* Comments updated

* Removed link

Removed @see link in header documentation

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* clang-format and clang-tidy fixes for cd8a5953

* made `tests()` static

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* added @returns in documentation of tests function

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* added @return in documentation of main function

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-24 21:54:38 +05:30
deDSeC00720
ffef54470d feat: LRU (Least recently used) cache - different implementation (#2783)
* feat: add lru cache

* test: add test to cover exception

* test: add assert for exception message

* review: change int to uint32_t

* review: add header for std::uint32_t

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-22 19:34:52 +05:30
Nguyen Phuc Chuong
37a9811372 docs, test: fit modular inverse fermat little theorem to contributing guidelines (#2779)
* Update modular_inverse_fermat_little_theorem.cpp

* Update modular_inverse_fermat_little_theorem.cpp

* Update modular_inverse_fermat_little_theorem.cpp

* Update modular_inverse_fermat_little_theorem.cpp

* Update math/modular_inverse_fermat_little_theorem.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update math/modular_inverse_fermat_little_theorem.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update modular_inverse_fermat_little_theorem.cpp

Add time complexity in comment

* Update modular_inverse_fermat_little_theorem.cpp

* Update modular_inverse_fermat_little_theorem.cpp

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-21 18:51:23 +05:30
github-actions[bot]
d438f0fc7f docs: update DIRECTORY.md (#2857)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-19 15:22:15 +05:30
Naman Jain
05d784d844 Longest Increasing subsequence using binary search most optimal approach (Modified) (#2776)
* Longest Increasing subsequence using binary search most optimal approach for this problem

* Longest Increasing subsequence using binary search most optimal approach for this problem

* Longest Increasing subsequence using binary search most optimal approach for this problem (Modified)

* Longest Increasing subsequence using binary search most optimal approach for this problem

* Longest Increasing subsequence using binary search most optimal approach for this problem(done)

* Longest Increasing subsequence using binary search most optimal approach for this problem

* Floyd warshall

* Longest Increasing subsequence using binary search most optimal approach for this problem

* Longest Increasing subsequence using binary search most optimal approach for this problem

* Longest Increasing subsequence using binary search most optimal approach for this problem

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-18 21:59:49 +05:30
github-actions[bot]
e841605280 docs: update DIRECTORY.md (#2827)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-14 18:49:11 +05:30
Harshil Shah
c2adc3b1e6 feat: Added Exponential Probability Distribution (#2780)
* Add Exponential Distribution

* Modified the documentation

* Update Documentation

* Update probability/exponential_dist.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update probability/exponential_dist.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update probability/exponential_dist.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update the files

* Removed the link from documentation

* docs: remove the second brief tag

* Update latex notation

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update latex notation

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Corrected format issues

* Update probability/exponential_dist.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update probability/exponential_dist.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update probability/exponential_dist.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Added more test, formatted with clang-format

* Update files

* Update format issues

* Add more tests

* Added namespaces

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-13 00:09:50 +05:30
Nguyen Phuc Chuong
136e6c0ad8 docs, test: Fit bubble_sort into guidelines and enhance bubble sort algorithm (#2800)
* Update bubble_sort.cpp

* Update bubble_sort.cpp

* Update bubble_sort.cpp

Add latex notation

* Update sorting/bubble_sort.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update sorting/bubble_sort.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update bubble_sort.cpp

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-11 09:57:30 +05:30
github-actions[bot]
49ee852d06 docs: update DIRECTORY.md (#2810)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-11 09:52:18 +05:30
Ashish Kumar Sahoo
5eff2b9e2b Create Longest_Substring_Without_Repeating_Characters.cpp (#2761)
* Create Longest_Substring_Without_Repeating_Characters.cpp

* I would like to contribute for sliding window algorithm and this one is one of the famous problem that is asked in interviews.

* Thank you!!.

* Update and rename Longest_Substring_Without_Repeating_Characters.cpp to sliding-window/Longest_Substring_Without_Repeating_Characters.cpp

* This is my contribution towards the sliding window algorithm/s and this is one of the famous problems.

* Thank you.

* Update Longest_Substring_Without_Repeating_Characters.cpp

* I would like to contribute towards the sliding window algorithm in which this is one of the famous problem asked in interviews.

* Thank you.

* Update Longest_Substring_Without_Repeating_Characters.cpp

* Updated certain changes in documentation, this is my contribution towards sliding window algorithm this is one of the famous interview problem.

* Thank you.

* Update Longest_Substring_Without_Repeating_Characters.cpp

* Well documented and tested code for sliding window algorithm.

* Thank you.

* Update and rename Longest_Substring_Without_Repeating_Characters.cpp to Longest_Substring_Without_Repeating_Characters.cpp

* So,I did a small change I added the problem into the others section I think this works fine I guess.

* I would be glad if this can be tagged as hackoctoberfest 

* Thank you.

* Update and rename Longest_Substring_Without_Repeating_Characters.cpp to longest_substring_without_repeating_characters.cpp

* I hope I have done the required changes.

* Update longest_substring_without_repeating_characters.cpp

* Added specific edge cases and tests as void tests() and followed the guidelines.

* Update longest_substring_without_repeating_characters.cpp

* I hope I have made the necessary changes required.

* If there are any changes to make I can do that.

* Thank you.

* Update longest_substring_without_repeating_characters.cpp

* I have done the required changes for the include part.

* Thank you.

* Update longest_substring_without_repeating_characters.cpp

added author name

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-10 19:58:50 +05:30
github-actions[bot]
34d3568b37 docs: update DIRECTORY.md (#2804)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-10 17:16:19 +05:30
Ritobroto Kalita
512efd1861 fix: Update documentations and tests for fibonacci.cpp (#2793)
* Update fibonacci.cpp

* update documentation

* Update documentation
2024-10-09 18:45:12 +05:30
Dhanush S
faff2177c8 feat: add recursive inserstion sort (#2764)
* added recursive insertion sort algorithm

* Modified the main function and removed user interaction as requested

* Deleted previous file

* Updated insertion_sort.cpp to its original code

* Created insertion_sort_recursive.cpp file

* Updated documentation and structure in  insertion_sort_recursive.cpp

* Updated documentation in  insertion_sort_recursive.cpp

* chore: remove redundant comment

* chore:Removed unnecssary whitespace

* doc: ease the brief of test

* doc: remove redundant lines from main

* chore:Removed redundant whitespace

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-08 19:34:42 +05:30
Muhammad Junaid Khalid
dd36279e73 feat: Digit Separation Algorithm added (#2759)
* Digit Separation Algorithm added

* feat: Added namespace greedy_algoriithms

* "Updated digit separation code: added comments and docstrings, changed data types to std::int64_t, and reformatted code."

* feat: Made test function and removed extra whitespaces

* removed some more whitespaces

* Update greedy_algorithms/digit_separation.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* fix: terminate multiline comment

* Update greedy_algorithms/digit_separation.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update greedy_algorithms/digit_separation.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update greedy_algorithms/digit_separation.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update greedy_algorithms/digit_separation.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Corrected test function

* Update greedy_algorithms/digit_separation.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update greedy_algorithms/digit_separation.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* remove redundant declaration

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Corrected tests

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* file clang linted

* "Moved method implementations from outside to inside class definition"

* fowardOrder to forwardOrder on line 122

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Removed Class scope resolution form digitSeparationReverseOrder function

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Removed Class scope resolution form digitSeparationForwardOrderfunction

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* docs: documentation updated

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-07 19:09:23 +05:30
deDSeC00720
821d20c33a feat: LFU (Least frequently used) cache (#2757)
* feat: add lfu cache

* docs: add comments and explanation to class LFUCache

* test: add tests for class lfu cache

* docs: document namespace and classes

* test: modify tests to check negative numbers

* docs: document template params and class data members

* test: make test func static and move tests in the same func

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-07 19:02:52 +05:30
Nguyen Phuc Chuong
fddedd8864 fix: Adding documentations, tests, and amending algorithm for gcd_of_n_numbers.cpp (#2766)
* Update gcd_of_n_numbers.cpp

* Update gcd_of_n_numbers.cpp

Reformatting code, comment and test cases, change array data type.

* Update gcd_of_n_numbers.cpp

* Update gcd_of_n_numbers.cpp

* Update gcd_of_n_numbers.cpp

* Update gcd_of_n_numbers.cpp
2024-10-07 18:56:25 +05:30
Harshil Shah
b957b1dfef feat: Add hemi-sphere area algorithm (#2767)
* Add area of hemi-sphere

* Update math/area.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-07 06:15:29 +05:30
github-actions[bot]
f9fb58fb87 docs: update DIRECTORY.md (#2771)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-06 08:09:04 +05:30
Amine Ghoussaini
60093d70ab feat: add duval's algorithm (#2725)
* feat: Add Duval's algorithm for the lexicographically smallest rotation in a sequence.

* fixes.

* fixes.
2024-10-05 18:22:02 +05:30