* 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>
* 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>
* 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>
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>
* 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>
* 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
* 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
* 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
* 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>
* 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