1776 Commits

Author SHA1 Message Date
Somraj Banik
fdcc29b0ac feat[probability]: add conditional probability algorithm (#3235)
* add conditional probability algorithm

* test: assert error messages, add new line at end of file, improve docs and test descriptions

* Apply self test comment

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

* docs: use proper latex syntax probability/conditional_probability.cpp

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2026-10-03 10:33:59 +00:00
realstealthninja
b64d5ecd02 ci: fix up .clang-tidy and related files (#3236)
* chore: remove clang-tidy deprecated option

* fix: lint and update workflow related items

* clang-format and clang-tidy fixes for 2aa6797d

* ci: add issues write to approved-label

* chore: remove file formatter

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-09-30 09:36:11 +00:00
Dmitry Rantovov
b3ba9f48b5 docs: drop the stray @param from the @returns lines in graham_scan_functions (#3220) 2026-09-29 07:53:48 +00:00
realstealthninja
6d81fa3762 fix: Remove undefined specialisation in uint128_t and uint256_t (#3232)
* fix: remove undefined specialisations

* fix: remove undefined behaviour of specialising std

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

* chore: bump freeglut

* chore: typo in sha256

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-09-21 13:45:29 +00:00
ssmurfgg04-gif
af6e2c8991 docs: remove dead Gitter link (#3227) 2026-09-21 04:12:39 +00:00
Piotr Idzik
b9c118fb5d style: remove interaction with the user (#3009)
* style: remove interaction with the user

Helps with #2753

* clang-format and clang-tidy fixes for ff441e08

* tests: add test with result being a zero vector

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

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2025-10-11 14:49:11 +00:00
realstealthninja
ba0d3fff49 ci: fix permissions issue with approved-label (#3017)
* ci: use a different action forlabelling on pr approval.

* ci: fix permissions issue with approved-label
2025-10-01 14:33:13 +00:00
realstealthninja
b5d818b15f ci: use a different action forlabelling on pr approval. (#3016) 2025-10-01 14:26:17 +00:00
Rudra Pratap Singh
35021501ff correct grammar and wording in contribution guidelines (#3012) 2025-10-01 11:45:38 +00:00
realstealthninja
be550cd912 ci: bump codeql to v3 (#3008) 2025-09-27 07:20:21 +00:00
realstealthninja
47badd959e chore: fix file formatter (#3007)
* chore: fix file formatter

* chore: remove else and make it a guard clause as it was initally
2025-09-27 07:09:24 +00:00
Piotr Idzik
643e0a96e0 style: remove interaction with the user (#3006)
Helps with #2753

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2025-09-27 04:56:46 +00:00
Rudra Pratap Singh
8541bb3674 Fix: use uint64_t for input and counter in countSetBits (#3003)
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2025-09-27 04:45:09 +00:00
Piotr Idzik
e72b7aa4e8 fix: handle wrong inputs in postfix_evaluation (#3005) 2025-09-26 12:32:31 +00:00
Piotr Idzik
07663b019b refactor: input size should not be a template argument in postfix_evaluation (#2996) 2025-09-25 07:13:04 +00:00
Vedant Mukhedkar
0301b4cd17 Added a bit manipulation program to determine even or odd numbers (#2959)
* Create check_even_odd.cpp

Implementation to Check if a number is Even or Odd using Bitwise Operator

* Update check_even_odd.cpp

* Create factorial_top_down_dp.cpp

* Delete dynamic_programming/factorial_top_down_dp.cpp

Deleted the one file as there was 2 files in the commit

* Create factorial_top_down_dp.cpp

* Delete dynamic_programming/factorial_top_down_dp.cpp

* Update bit_manipulation/check_even_odd.cpp

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

* Update bit_manipulation/check_even_odd.cpp

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

* Update bit_manipulation/check_even_odd.cpp

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

* Update bit_manipulation/check_even_odd.cpp

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

* Update check_even_odd.cpp

modified

* Update check_even_odd.cpp

reverted to boolean to check if number is even or not

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2025-09-24 03:47:05 +00:00
Piotr Idzik
3aafade824 fix: remove potential segv from postfix_evaluation.cpp (#2995) 2025-09-10 03:12:28 +00:00
Piotr Idzik
43ce63682a fix: remove potential segmentation fault from factorial_memoization.cpp (#2994) 2025-09-05 12:31:44 +00:00
9santa
63aa8595cd doc: fix a typo in ccl.h(#2993)
Fixed "Cicular" -> "Circular"

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2025-09-04 16:12:16 +00:00
Piotr Idzik
651d622775 style: remove unused variable (#2991) 2025-09-04 15:54:23 +00:00
Piotr Idzik
35b1bcbe44 style: resolve -Wunused-parameter (#2990) 2025-09-01 02:23:40 +00:00
realstealthninja
0bd697db79 doc: update versions in readme (#2987) 2025-08-24 01:12:10 +00:00
Vedant Mukhedkar
f1ff652601 feat: Add memoized version of factorial (#2964)
* Create check_even_odd.cpp

Implementation to Check if a number is Even or Odd using Bitwise Operator

* Update check_even_odd.cpp

* Create factorial_top_down_dp.cpp

* Delete dynamic_programming/factorial_top_down_dp.cpp

Deleted the one file as there was 2 files in the commit

* Create factorial_top_down_dp.cpp

* Delete bit_manipulation/check_even_odd.cpp

* Update dynamic_programming/factorial_top_down_dp.cpp

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

* Update dynamic_programming/factorial_top_down_dp.cpp

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

* Update dynamic_programming/factorial_top_down_dp.cpp

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

* Update factorial_top_down_dp.cpp

modified

* Update factorial_top_down_dp.cpp

added __uint128_t for handling  fixed-width integer types

* Create memoised_factorial.cpp

* Rename memoised_factorial.cpp to factorial_memoization.cpp

* Update factorial_memoization.cpp

* Delete dynamic_programming/factorial_top_down_dp.cpp

deleted the file from dp folder

* Update math/factorial_memoization.cpp

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

* Update factorial_memoization.cpp

added cstdint header and switched to uint64 Thanks

* fix: wrap factorial functions under math namespace

* chore: add scope specifier in test cases

* doc: add documentation to headers

* doc: add defintion of memoisation as well as rewrite brief

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2025-08-23 14:45:40 +00:00
realstealthninja
4d1aa26af4 ci: add pull_request write permission (#2985) 2025-08-22 15:04:49 +00:00
kaushal sawariya
c39d84b50b chore: make acceleration due to gravity a constexpr (#2982)
* Added constexpr GRAVITY constant (9.80665) as per guidelines

* Merge branch 'master' into feature/add-gravity-constant

* Update physics/ground_to_ground_projectile_motion.cpp

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

* Merge branch 'master' into feature/add-gravity-constant
2025-08-19 00:13:35 +00:00
Piotr Idzik
c917fc4560 fix: initialise key to avoid undefined behaviour (#2984) 2025-08-18 16:17:45 +00:00
Aditya Borate
b30bdd30bf feat: add algorithm to find the number of paths in a graph using DFS (#2815)
* feat: add count_paths algorithm with a test case

* fix: updated number_of_paths algorithm, added more test cases, and set unsigned int as parameter

* fix: replaced unsigned int with std::uint32_t for fixed size

* fix: Handled empty graph, invalid input and added test cases for the same

* clang-format and clang-tidy fixes for 80e27baa

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-08-17 21:47:53 +00:00
Piotr Idzik
93c64b558a fix: use strict inequality to avoid containerOutOfBounds (#2981) 2025-08-17 10:13:02 +00:00
github-actions[bot]
a77ce5c5cf docs: update DIRECTORY.md (#2980)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2025-08-16 13:46:41 +00:00
Piotr Idzik
63931308e4 fix: resize array to avoid arrayIndexOutOfBounds (#2979) 2025-08-16 04:58:06 +00:00
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