Commit Graph

1638 Commits

Author SHA1 Message Date
ewd00010
e3f0551f98
[fix/docs]: fit check_amicable_pair.cpp to guidelines (#2465)
* Quality of life

FIX:  initlized sum to 1 instead of adding it before return
CHORE: cleaned documentation aswell as adding new documentation, namespace math added

* Update math/check_amicable_pair.cpp

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

* Update math/check_amicable_pair.cpp

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

* Update math/check_amicable_pair.cpp

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

* Update math/check_amicable_pair.cpp

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

* clang-format and clang-tidy fixes for bc87fea5

* clang-format and clang-tidy fixes for 0a19d1ad

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
2023-06-23 14:06:42 -06:00
David Leal
72cd2d0eb9
fix: directory writer on event 2023-06-23 13:51:00 -06:00
kunal nayak
d1ec37c67b
feat: add Next Higher Number with same set bits (#2484)
* Next higher number with same set bits implimented

* Added to DIRECTORY.md

* Update bit_manipulation/next_higher_number_with_same_number_of_set_bits.cpp

new line aded

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

* Update bit_manipulation/next_higher_number_with_same_number_of_set_bits.cpp

* added

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

* Update bit_manipulation/next_higher_number_with_same_number_of_set_bits.cpp

recomendation added

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

* Update next_higher_number_with_same_number_of_set_bits.cpp

int to int64_t

* Update bit_manipulation/next_higher_number_with_same_number_of_set_bits.cpp

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

---------

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2023-06-23 13:45:11 -06:00
David Leal
e203bfee4e
fix: use correct branch name 2023-06-23 12:04:16 -06:00
realstealthninja
2fd530cba1
[fix/docs]: fit armstrong_number.cpp to guidelines (#2457)
* fix: fit armstrong_number.cpp to guidelines

* chore: delete unnecessary whitespace

* updating DIRECTORY.md

* fit: aliquot_sum to contribution guidelines

added a math formula

* chore: add print statement mentioning tests have passed

* Update math/armstrong_number.cpp

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

* Update math/armstrong_number.cpp

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

---------

Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2023-06-20 16:00:41 -06:00
David Leal
5dc34677ed
Revert "feat: update CMake version" (#2489)
* Revert "feat: update CMake version to 3.26.4 (#2486)"

This reverts commit 2d492834b1.

* clang-format and clang-tidy fixes for d40bf643

---------

Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
2023-06-20 15:49:45 -06:00
Sujal Gupta
2d492834b1
feat: update CMake version to 3.26.4 (#2486)
* update cmake version

* clang-format and clang-tidy fixes for 402c5627

---------

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
2023-06-16 16:08:45 -06:00
Stoycho Kyosev
d7a9869dce
feat: add Boyer Moore algorithm implementation (#2441)
* add boyer moore algorithm implementation

* add a one-line description of what the library/header is for

* fix comments pattern and make tests static

* add documentation

* add namespaces

* fix all warnings for clang-tydy.exe <filename>

* Change lib from limits to climits (CHAR_MAX macro)

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

* Add breif description of boyer-moore algorithm

* Fix styling

* Add needed documentation

* my commit

* fix type of index_pattern

* Fix clang-warnings

* chore: apply suggestions from code review

* chore: add print message after tests

* Update strings/boyer_moore.cpp

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

* Update strings/boyer_moore.cpp

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

* Update strings/boyer_moore.cpp

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

* Update strings/boyer_moore.cpp

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

* Update strings/boyer_moore.cpp

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

* Update strings/boyer_moore.cpp

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

* Update strings/boyer_moore.cpp

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

* Update strings/boyer_moore.cpp

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

* Update strings/boyer_moore.cpp

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

* fix: variable name

* Update strings/boyer_moore.cpp

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

---------

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2023-06-16 15:38:38 -06:00
ewd00010
5ef7ad5cfe
[feat/docs/fix]: fit check_prime.cpp to guidelines (#2460)
* check_prime_update

docs: added links to file @brief and @details. moved previous @brief to be with function, made comments easier to read in general and added boilerplate documentation to functions.
chore: removed bool result and most brackets in is_prime. Moved assert tests to their own function and added more in, test success now returns message.

* Delete cmake-build-debug directory

* clang-format

* original box_stacking documentation

start point

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Delete box_stacking.cpp

* Update check_prime.cpp

improved files @details text, removed generic t template - replaced with long long

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Update check_prime.cpp

removed cin/cout interaction

* Update check_prime.cpp

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Update check_prime.cpp

* Update math/check_prime.cpp

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

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2023-06-16 15:27:53 -06:00
ewd00010
5704841875
[feat/docs/fix]: fit check_factorial.cpp to guidelines (#2466)
* Quality of life update

FIX: added namespace math, changed for a weird for loop to a while loop with a better conditional and I initiation
CHORE: Cleaned documentation and added details plus links. removed the invalid cout lines in test for one line.

* Update math/check_factorial.cpp

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

* Update math/check_factorial.cpp

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

* Update math/check_factorial.cpp

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

* Update math/check_factorial.cpp

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

* Update math/check_factorial.cpp

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

* Update math/check_factorial.cpp

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

* Update math/check_factorial.cpp

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

* Update math/check_factorial.cpp

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

* chore: apply suggestions from code review

* Updated last return in is_factorial

* Update math/check_factorial.cpp

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

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2023-06-16 15:25:06 -06:00
Md. Anisul Haque
ff80be4b0a
feat: Add SHA-256 hashing algorithm (#2470)
* feat: add sha256 algorithm

* Apply suggestions from code review

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>

* fix: suggested changes

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for de9c0b9c

* fix: suggested changes

* fix: suggested changes

* clang-format and clang-tidy fixes for 86e65fe8

* fix: suggested changes

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>

* Update hashing/sha256.cpp

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>

* fix: suggested changes

* fix: Apply suggestions from code review

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>

* clang-format and clang-tidy fixes for a3d73339

* fix: suggested changes

* fix: made some required changes

* fix: suggested changes

* fix: Apply suggestions from code review

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>

* clang-format and clang-tidy fixes for 356be83b

* fix: suggested changes

* fix: added more tests

* fix: Apply suggestions from code review

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>

* fix: suggested changes

* chore: apply suggestions from code review

* chore: add print message after tests

* clang-format and clang-tidy fixes for 48191bbe

* fix: suggested changes

---------

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2023-06-16 15:24:31 -06:00
David Leal
1bfd46e92c
docs: update workflow versions in README.md (#2483) 2023-06-16 15:18:06 -06:00
David Leal
1a6ca12456
feat: add physics to CMake lists (#2481) 2023-06-16 15:17:34 -06:00
David Leal
0953376d31
feat: use directory workflow from the... (#2485)
...`scripts` repository
2023-06-16 15:12:12 -06:00
David Leal
4aa529c728
chore: remove Taj from codeowners 2023-06-14 09:32:13 -06:00
David Leal
b0b183df92
feat: add memory game and a games folder (#2471)
* feat: add memory game and a games folder

* fix: `clang-tidy` warnings (hopefully)

* fix: use `random_shuffle`

`random_shuffle` was removed in C++17, however, we're using C++11 here, so there should be no harm.

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 8cd0a772

* fix: remove repeated `random` header

* clang-format and clang-tidy fixes for 02786880

* fix: Windows build errors

* fix: CI warnings (hopefully)

* fix: CI warnings

* fix: (finally) CI warnings

* fix: wrong parameter name

* fix: yet another attempt to fix CI

---------

Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
2023-06-12 10:17:36 -06:00
David Leal
26f6e98d9e
chore: add cpu_scheduling_algorithms to CMake (#2477) 2023-06-09 10:08:38 -06:00
David Leal
c876e50a7b
feat: add Kelvin to Celsius conversion algorithm (#2475)
* feat: add Kelvin to Celsius conversion algorithm

* updating DIRECTORY.md

* chore: apply suggestions from code review

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>

* chore: apply suggestions from code review

Co-authored-by: Piotr Idzik <vil02@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
Co-authored-by: Piotr Idzik <vil02@users.noreply.github.com>
2023-06-08 10:03:59 -06:00
David Leal
ea4100e394
chore: add codeowners (#2474) 2023-05-31 11:51:36 -06:00
Piotr Idzik
33750ec1f8
fix: cover the cases n == 0 and m < n in N_bonacci (#2468)
* fix: make N_bonacci return an array of size m

* tests: simplify test, add new test cases

* style: remove unused include, update include justifications

* fix: cover the case n == 0
2023-05-30 20:48:05 -06:00
David Leal
0934ec4a8a
feat: label PR on CI fail (WIP) (#2455)
* feat: label PR on CI fail

* updating DIRECTORY.md

---------

Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
2023-05-19 19:23:40 -06:00
David Leal
4f4585d4c1
docs: improve longest_palindromic_subsequence.cpp (#2467) 2023-05-19 19:22:54 -06:00
Piotr Idzik
4fc14710b6
fix: segv in longest_palindromic_subsequence.cpp (#2461)
* fix: initialise properly res, set properly size of ans

* test: add check with empty input

* style: use const reference as input type

* refactor: add ind_type

* style: use reverse interators to b

* style: use auto in definition of idx

* updating DIRECTORY.md

* style: clean-up includes

* style: use std::string::size_type in definition of ind_type

---------

Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2023-05-18 11:26:06 -06:00
WoWS17
6027480643
feat: add well-formed parentheses generator (#2445)
* feat: add well-formed parentheses generator

* updating DIRECTORY.md

* changes made

* Update backtracking/generate_parentheses.cpp

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

* Update backtracking/generate_parentheses.cpp

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

* Update backtracking/generate_parentheses.cpp

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

* Update backtracking/generate_parentheses.cpp

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

* Update backtracking/generate_parentheses.cpp

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

* Update backtracking/generate_parentheses.cpp

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

* Update backtracking/generate_parentheses.cpp

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

* Update backtracking/generate_parentheses.cpp

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

* Update backtracking/generate_parentheses.cpp

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

* Update backtracking/generate_parentheses.cpp

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

* Update backtracking/generate_parentheses.cpp

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

* chore: apply suggestions from code review

* Update backtracking/generate_parentheses.cpp

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

* updating DIRECTORY.md

---------

Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2023-05-16 13:32:47 -06:00
realstealthninja
4b740d464c
fix: fit euler's totient to the contribution guidelines (#2447)
* fix: fit euler's totient to the contribution guidelines.

* Update math/eulers_totient_function.cpp

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

* Update math/eulers_totient_function.cpp

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

* fix: add more tests

notes: i should have added euler's number first

* fix: revert description

* Update math/eulers_totient_function.cpp

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

* Update math/eulers_totient_function.cpp

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

* chore: apply suggestions from code review

* chore: apply suggestions from code review

---------

Co-authored-by: David Leal <halfpacho@gmail.com>
2023-04-28 13:56:52 -06:00
Stressed
a0227012ec
feat: add Quadratic equations complex numbers (#2451)
* Added quadratic_equations_complex_numbers.cpp

* Added a demonstration

* Added test cases

* Added test cases

* Revert "Added test cases"

This reverts commit a1433a9318.

* Added test cases and made docs /// instead of //

* test: Added test cases for quadraticEquation
docs: Changed comment style

* test: more test cases
docs: added documentation

* docs: Updated description

* chore: removed redundant returns

* chore: fixed formatting to pass Code Formatter checks

* chore: apply suggestions from code review

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

* test: Added exception test

* Update math/quadratic_equations_complex_numbers.cpp

Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>

* Update math/quadratic_equations_complex_numbers.cpp

Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>

* Update math/quadratic_equations_complex_numbers.cpp

Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>

---------

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>
2023-04-28 13:53:19 -06:00
Nishant Chatterjee
1a1570d775
feat: Segment Tree Data Structure (#2444)
* Segment Tree

* fix: conformed to guidelines

* fix: changed int to template type T in few places

* fix: suggested changes

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

* fix: suggested changes

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

* fixed: suggested changes

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

* fix: suggested changes

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

* fix: suggested changes

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

* fix: suggested changes

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

* fix: suggested changes

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

* fix: suggested changes

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

* fix: suggested changes

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

* fix: remove duplicate line

* Update segment_tree.cpp

* chore: apply suggestions from code review

---------

Co-authored-by: David Leal <halfpacho@gmail.com>
2023-04-28 08:43:22 -06:00
David Leal
c0c27153cd
fix: self-test example not working 2023-04-26 19:08:19 -06:00
David Leal
4ca4333efe
docs: add more tests in the contributing guidelines 2023-04-26 18:59:57 -06:00
David Leal
fe671029c3
docs: improve contributing guidelines 2023-04-26 11:26:03 -06:00
David Leal
eb8bb3c4ee
chore: fix CodeQL badge 2023-04-23 00:23:50 -06:00
David Leal
7999ff54ae
docs: add missing return 0; 2023-04-21 10:12:03 -06:00
David Leal
842c4ab5dd
docs: add self-test examples (#2452)
* docs: add self-test examples

* updating DIRECTORY.md

---------

Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
2023-04-21 10:10:54 -06:00
Mindaugas
29f54393f3
feat: add Stooge sort algorithm (#2440)
* feat: add Stooge sort algorithm

* docs: add documentation for function parameters and includes

* test: add new tests for the Stooge sort

* docs: Update functions descriptions

* fix: Update parameter type to size_t

* doc: Add message that the tests have passed

* fix: Update return statement structure

---------

Co-authored-by: David Leal <halfpacho@gmail.com>
2023-04-14 17:53:25 -06:00
David Leal
f04e038056
chore: update the CodeQL workflow (#2449) 2023-04-14 17:41:02 -06:00
futoid
fddbf08f5a
feat: added log code for counting digits (#2234)
* added log code for counting digits

* one space removed

* fix: CI warnings (hopefully)

* fix: revert for now

* decoupled test functions

* Update math/finding_number_of_digits_in_a_number.cpp

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

* Update math/finding_number_of_digits_in_a_number.cpp

typo changes

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

* uint64_t changed to double to resolve clang-tidy warnings

* clang-format and clang-tidy fixes for 61bb2dea

* comment improvement

* clang-format and clang-tidy fixes for 39ebc33d

* guarded required function

---------

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
2023-04-14 12:40:14 -06:00
Piotr Idzik
65efd47bc1
fix: remove memory leak in reverse_a_linked_list.cpp (#2439)
* style: remove unused header

* fix: add destructor to list

* style: add missing constructors, make some methods const

* fix: google-readability-braces-around-statements

* fix: suppress some warnings

* docs: remove meaningless documentation

* docs: add missing documentation

* style: check if isEmpty in copy_all_nodes_from_list

* style: declare variables in seperate lines

Co-authored-by: David Leal <halfpacho@gmail.com>
2023-03-30 14:19:26 -06:00
David Leal
1d2c5d9d97
feat: add Sieve of Eratosthenes (originally by @thechubbypanda) (#2442)
* feat: add Sieve of Eratosthenes

Originally created by @thechubbypanda.

* updating DIRECTORY.md

---------

Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
Co-authored-by: Keval Kapdee <keval@thechubbypanda.net>
2023-03-29 14:24:13 -06:00
Suman Mondal
0f20cdcf8f
feat: add maximum circular subarray sum (#2242)
* Create maximum_circular_subarray.cpp

* Delete maximum_circular_subarray.cpp

* Create maximum_circular_subarray.cpp

* Update maximum_circular_subarray.cpp

Used the template provided.

* updating DIRECTORY.md

* Update maximum_circular_subarray.cpp

* Update maximum_circular_subarray.cpp

* Update maximum_circular_subarray.cpp

* Update maximum_circular_subarray.cpp

* Update maximum_circular_subarray.cpp

* Update dynamic_programming/maximum_circular_subarray.cpp

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

* Update maximum_circular_subarray.cpp

* Update dynamic_programming/maximum_circular_subarray.cpp

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

* Update dynamic_programming/maximum_circular_subarray.cpp

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

* Update dynamic_programming/maximum_circular_subarray.cpp

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

* Update dynamic_programming/maximum_circular_subarray.cpp

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

* Update dynamic_programming/maximum_circular_subarray.cpp

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

* Update dynamic_programming/maximum_circular_subarray.cpp

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

* Update maximum_circular_subarray.cpp

Fixed the comments according to @krishnacx

* chore: apply suggestions from code review

---------

Co-authored-by: Suman Mondal <94859440+sumanarlert@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2023-02-06 14:11:52 -06:00
Piotr Idzik
cc33efd3b6
[fix/feat]: remove memory leak in avltree.cpp (#2429)
* fix: remove memory leak by adding deleteAllNodes

* clang-format and clang-tidy fixes for 9d76f8bd

* docs: explain usage of standard headers

* docs: use doxygen syntax

* docs: document parameters of the functions

* style: use proper spelling

* style: simplify logic in deleteNode

* docs: add missing [in]

* docs: add missing slashes

* docs: document `main`

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

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for c852f62d

---------

Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2023-02-03 18:40:26 -06:00
Prafful Gupta
dc8ecfbf50
feat: add power of two algorithm (#2224)
* feat: add power_of_two.cpp

* chore: minor changes

* fix: Windows CI issues

* chore: remove unnecessary namespace

---------

Co-authored-by: David Leal <halfpacho@gmail.com>
2023-02-03 15:12:19 -06:00
Luiz Carlos Cosmi Filho
a8af29bf65
feat: add k-nearest neighbors algorithm (#2416)
* feat: add k-nearest neighbors, class Knn

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 8dfacfdf

* fix: comments in k-nearest neighbors

* test: add more tests for k-nearest-neighbors algorithm

* fix: description of k-nearest neighbors algorithm

* chore: apply suggestions from code review

---------

Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2023-01-31 13:47:26 -06:00
David Leal
b89d1da2f1
chore: update FreeGLUT to v3.2.2 (#2432) 2023-01-31 10:20:47 -06:00
Piotr Idzik
7c090481da
[fix/docs]: remove memory leak in queue (#2417)
* fix: remove memory leak in queue

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for effd74c9

* style: simplify logic while using reserve

* style: use value_type as return type in front

* style: use proper error message

* style: use pre-increment and pre-decrement

* docs: use doxygen syntax

* docs: improve wording

Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2023-01-26 00:29:37 -06:00
Ashish Bhanu Daulatabad
5b238724b8
feat: add Strassen's Matrix Multiplication (#2413)
* Feat: Add Strassen's matrix multiplication

* updating DIRECTORY.md

* Fix cpp lint error

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 02439b57

* Fix windows error

* Add namespaces

* updating DIRECTORY.md

* Proper documentation

* Reduce the matrix size.

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 0545555a

Co-authored-by: toastedbreadandomelette <toastedbreadandomelette@gmail.com>
Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2023-01-24 14:03:06 -06:00
KillerAV
a6a9d8e75a
feat: add Subset Sum (#2020)
* Create subset_sum.cpp

* Update subset_sum.cpp

Lint formatting.

* chore: apply suggestions from code review

* chore: apply suggestions from code review

* fix: CI issues

Co-authored-by: David Leal <halfpacho@gmail.com>
2023-01-24 13:55:55 -06:00
Jason
f093837c78
feat: add Boruvkas Algorithm (#1984)
* Boruvkas Algorithm Implementation

Implemented Boruvkas Algorithm under graphs as a means for finding the minimums spanning tree

* Boruvkas Algorithm Implementation

Implemented Boruvkas algorithm, a greedy algorithm to find a graphs minimum spanning tree.

* Update climits

limits.h to climits

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

* Fixes for maintainability

Made changes as recommended by Panquesito7 for maintainability and security

* Fixed boruvkas main

Made suggested changes

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

* Suggested changes for Boruvkas

Changed from graph to greedy algorithm, removed the extra main(), general fixes

* Update Boruvkas readability, CI Workflow

General readability changes, change push_back to implace_back

* Update Boruvkas memory allocation

Added pre-allocation of memory for the parent vector of Boruvkas

* Fixed file name, added namespace

Fixed file name, added Boruvkas namespace, made suggested changes

* Update boruvkas spacing

Fixed spacing hopefully

* Update boruvkas spacing

Fixing weird tabs

* Update Boruvkas tabs spacings

Finally done with spacing i think

* Boruvkas - Finished spacing

Triplle checked tabs/spaces

* chore: apply suggestions from code review

* fix: CI issues (hopefully)

* fix: last fix

Co-authored-by: David Leal <halfpacho@gmail.com>
2023-01-24 13:53:25 -06:00
Defective Detective
249ba8877d
feat: Add aliquot sum of a number algorithm, class Math (#2400)
* Added aliquot_sum.cpp

* Fixed indentation and changed argument to ull int

* Fixed type of I

* Made parameter as const

* Made some required changes

* Added changes due to namespace

* Formatting changes

Co-authored-by: David Leal <halfpacho@gmail.com>
2023-01-22 14:42:58 -06:00
Utkarsh Yadav
0931d530ae
feat: Added Travelling Salesman Problem using bit-manipulation (#2136)
* adding travelling_salesman problem using bitmanipulation

* listing travelling_salesman problem in directory.md file

* adding requested changes

* updating DIRECTORY.md

* chore: apply suggestions from code review

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
2023-01-22 13:39:03 -06:00
Piotr Idzik
e2bf654e82
[feat/fix]: improve the data stack implementations (#2235)
* fix: remove memory leak in stack

* style: use camelCase

* style: simplify logic

* style: rename stack.h to stack.hpp

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 2205c6f1

* fix: remove redundant file name

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

* clang-format and clang-tidy fixes for a080aaa2

* refactor: use std::shared_ptr

* fix: use C++11

* chore: synchronize with master (#2)

* chore: fix Markdown formatting in `dynamic_programming/kadane2.cpp` (#2276)

* docs: fix grammatical errors and typos (#2201)

* docs: fix grammatical errors and typos

* compilation error fixed

* Revert "compilation error fixed"

This reverts commit 0083cbfd1a.

* feat: added physics directory and ground to ground projectile motion algorithm (#2279)

* feat: added physics folder, ground to ground projectile motion calculations

* feat: added max height function

* fix: bug in angle calculations

* test: added test cases

* docs: added comments to test case variables

* docs: added comments to calculations

* fix: changed floats to doubles

* updating DIRECTORY.md

* Update physics/ground_to_ground_projectile_motion.cpp

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

* chore: add missing namespace

* rerun checks

Co-authored-by: David <Panquesito7@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>

* docs: updated a logically wrong doc comment (#2329)

* feat: add CMakeLists to the `divide_and_conquer` directory (#2072)

* fix: stairs pattern not printing slash (#2111)

when we propose 2 backslash then it doesn't take it as a comment and gets printed

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

* fix: use FreeGlut newest GitHub link (#2397)

* updating DIRECTORY.md

* fix: use FreeGlut newest GitHub link

* chore(fix): `data_strcutres` -> `data_structures` (#2399)

* feat: add Find non repeating number implementation (#2061)

* add find_single_number

* add fix issues

* remove .vscode

* add .vscode

* Update .vscode/settings.json

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

* chore(fix): minor issues

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

* [feat/docs]: improve the `quick_sort.cpp` algorithm (#2396)

* [feat/docs]: improve the `quick_sort.cpp`...

...algorithm implementation.

* clang-format and clang-tidy fixes for 40c858ba

* chore(fix): add original author

* updating DIRECTORY.md

* chore: update Discord links (#2407)

* docs: remove unneeded Markdown header

* feat: improve the Awesome Workflow (#2408)

* fix: Awesome Workflow issues

Thanks to @tjgurwara99 for the original fix: TheAlgorithms/C#1176

* chore: apply suggestions from code review

Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>

* feat: various improvements

* chore: apply suggestions from code review

Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>

* chore: remove LGTM and fix...

...CodeQL badges.

* docs: add guide on integrating CMake (#2410)

Taken from TheAlgorithms/C#1163

* updating DIRECTORY.md

Co-authored-by: Daemon <90456722+Daemon19@users.noreply.github.com>
Co-authored-by: aadarshkt <72285744+aadarshkt@users.noreply.github.com>
Co-authored-by: Focus <65309793+Focusucof@users.noreply.github.com>
Co-authored-by: David <Panquesito7@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: Arjit Malik <arjitmalik2001@gmail.com>
Co-authored-by: Harsh Singh <94822101+harshsingh510@users.noreply.github.com>
Co-authored-by: Ravi Dev Pandey <62198564+literalEval@users.noreply.github.com>
Co-authored-by: Mehmet <110852769+walterwhite351@users.noreply.github.com>
Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>

* docs: update authors and include comments

apply suggestions of @Panquesito7

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

* style: apply clang-format

* clang-format and clang-tidy fixes for b35b7214

* style: make display and isEmptyStack const

* tests: remove test_stack_legacy.cpp

* style: throw invalid_argument from top and pop if stack empty

* updating DIRECTORY.md

* style: add missing include docs, remove cassert

* style: use assert macro, document includes

* fix: use const reference in lambdas in display and toVector

* style: remove shared_ptr from traverse

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: Daemon <90456722+Daemon19@users.noreply.github.com>
Co-authored-by: aadarshkt <72285744+aadarshkt@users.noreply.github.com>
Co-authored-by: Focus <65309793+Focusucof@users.noreply.github.com>
Co-authored-by: Arjit Malik <arjitmalik2001@gmail.com>
Co-authored-by: Harsh Singh <94822101+harshsingh510@users.noreply.github.com>
Co-authored-by: Ravi Dev Pandey <62198564+literalEval@users.noreply.github.com>
Co-authored-by: Mehmet <110852769+walterwhite351@users.noreply.github.com>
Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
2023-01-10 09:32:09 -06:00