1771 Commits

Author SHA1 Message Date
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
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