Commit Graph

1546 Commits

Author SHA1 Message Date
Lajat5
909f7b8bb2
feat: add Recursive tree traversal techniques (#1865)
* feat: add Recursive tree traversal techniques

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for c69b85b5

* Update recursive_tree_traversal.cpp

* clang-format and clang-tidy fixes for 99f1cec8

* Update recursive_tree_traversal.cpp

* Update others/recursive_tree_traversal.cpp

Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>

* Update others/recursive_tree_traversal.cpp

Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>

* Update others/recursive_tree_traversal.cpp

Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>

* Update others/recursive_tree_traversal.cpp

Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>

* Update others/recursive_tree_traversal.cpp

Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>

* Update others/recursive_tree_traversal.cpp

Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>

* Update others/recursive_tree_traversal.cpp

Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>

* Create recursive_tree_traversal.cpp

Co-authored-by: David <Panquesito7@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>
2022-01-11 19:00:30 -06:00
Yash Raj Singh
70d07ff917
feat: add count_bits_flip.cpp (#1862)
* Added count_bits_flip.cpp

* updating DIRECTORY.md

* Update bit_manipulation/count_bits_flip.cpp

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

* clang-format and clang-tidy fixes for 7608314d

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David <Panquesito7@users.noreply.github.com>
Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>
2022-01-11 12:51:39 -06:00
Siddhartha Shankar Padhy
e6b17203c7
feat: add binary_insertion_sort (#1850)
* Add binary_insertion_sort.cpp

* Update binary_insertion_sort.cpp

* Update sorting/binary_insertion_sort.cpp

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

* Update binary_insertion_sort.cpp

* Update binary_insertion_sort.cpp

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for d48126b7

* clang-format and clang-tidy fixes for 30cafcab

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>
2022-01-11 12:39:41 -06:00
Lajat5
5592f0449b
feat: Reworked binary_search.cpp (#1854)
* feat: Reworked binary_search.cpp

* clang-format and clang-tidy fixes for 137be8ab

* Update search/binary_search.cpp

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

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2022-01-07 15:44:04 -06:00
Lajat5
19f48ae202
feat: Reworked interpolation_search.cpp (#1855)
* feat: Reworked interpolation_search.cpp

* Update interpolation_search.cpp

* clang-format and clang-tidy fixes for c98405b3

* Update search/interpolation_search.cpp

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

* Update search/interpolation_search.cpp

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

* Update search/interpolation_search.cpp

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

* Update search/interpolation_search.cpp

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

* clang-format and clang-tidy fixes for d4eac660

* Update search/interpolation_search.cpp

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

* Update search/interpolation_search.cpp

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

* fix: apply suggestions from code review

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2022-01-01 21:42:12 -06:00
David Leal
fe692e8e01
fix: CI workflow not being able to commit to the master branch (#1840)
* fix: CI workflow not being able to commit to...

...the `master` branch.
This is due to the branch protection: we cannot add `github-actions` as administrator to skip the protection. So let's add my name which has administrator permissions, that should work.

UNTESTED, might not work.

* Let's test it

* updating DIRECTORY.md

Co-authored-by: David <Panquesito7@users.noreply.github.com>
2022-01-01 20:46:47 -06:00
Goyal-Akshit
946cb99430
fix: spelling mistake for "Visual" (#1853)
For the comment "// use this for MS Visucal C++"
Change "Visucal" to "Visual"
2021-12-07 11:54:48 -06:00
David Leal
943b0d2f73
fix: Discord logo's color 2021-12-06 14:51:42 -06:00
Lajat5
ea76786f12
feat: Added Graham Scan Algorithm. (#1836)
* Implementated Grahamscan Algorithm for Convex Hull

* Update graham_scan_algorithm.cpp

* Update graham_scan_functions.h

* Update graham_scan_algorithm.cpp

* Update graham_scan_functions.h

* Update graham_scan_algorithm.cpp

* Update and rename graham_scan_functions.h to graham_scan_functions.hpp

* Update geometry/graham_scan_algorithm.cpp

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

* Update geometry/graham_scan_algorithm.cpp

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

* Update geometry/graham_scan_functions.hpp

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

* Update geometry/graham_scan_functions.hpp

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

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for e89e4c8c

* clang-format and clang-tidy fixes for 7df4778f

* Fix #1

* Update graham_scan_functions.hpp

* Delete composite_simpson_rule.cpp

* Delete inverse_fast_fourier_transform.cpp

* Fix #2

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 69b6832b

* Fix #3

* clang-format and clang-tidy fixes for 1c05ca7c

* Update graham_scan_functions.hpp

* Fix #4

* clang-format and clang-tidy fixes for 2957fd21

* Create composite_simpson_rule.cpp

* updating DIRECTORY.md

* Create inverse_fast_fourier_transform.cpp

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 405d21a5

* clang-format and clang-tidy fixes for 333ef5ca

* Update geometry/graham_scan_functions.hpp

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

* Update geometry/graham_scan_algorithm.cpp

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

* Update geometry/graham_scan_algorithm.cpp

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

* Update geometry/graham_scan_algorithm.cpp

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

* Update geometry/graham_scan_functions.hpp

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

* Update geometry/graham_scan_algorithm.cpp

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

* Update geometry/graham_scan_algorithm.cpp

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

* clang-format and clang-tidy fixes for ee4cb635

* Update graham_scan_algorithm.cpp

* Update graham_scan_functions.hpp

* clang-format and clang-tidy fixes for f2f69234

* Update graham_scan_functions.hpp

* Create partition_problem.cpp

* Update partition_problem.cpp

* Delete partition_problem.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-11-14 10:56:46 -06:00
Lajat5
5147306db3
feat: Added Solution of Partition Problem (#1842)
* Create partition_problem.cpp

* Fix #1

* Fix #2

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 3b8dbf00

* Update dynamic_programming/partition_problem.cpp

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

* Update dynamic_programming/partition_problem.cpp

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

* clang-format and clang-tidy fixes for a152bf75

* Update dynamic_programming/partition_problem.cpp

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

* Update dynamic_programming/partition_problem.cpp

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

* Update dynamic_programming/partition_problem.cpp

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

* clang-format and clang-tidy fixes for 1c057113

* Update dynamic_programming/partition_problem.cpp

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

* Update dynamic_programming/partition_problem.cpp

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

* clang-format and clang-tidy fixes for baf20a6f

* Update dynamic_programming/partition_problem.cpp

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

* clang-format and clang-tidy fixes for 749d9337

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2021-11-14 10:55:54 -06:00
rynrin
5074ed296b
fix: a typo in data_structures/linked_list.cpp (#1843) 2021-11-14 00:33:16 -06:00
David Leal
e6d7002405
feat: Add contact links in the issue template configuration 2021-11-11 17:47:11 -06:00
2kindsofcs
e64e3df18f
fix: CodeQL warnings (#1827)
* fix: CodeQL warnings

* clang-format and clang-tidy fixes for 4d357c46

* clang-format and clang-tidy fixes for 72322fb7

* accept suggestion

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

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Ayaan Khan <ayaankhan98@gmail.com>
2021-11-07 11:49:33 -06:00
Ameya Chawla
b98dcdfd08
feat : Implemented Babylonian Method (#1837)
* feat : Implemented Babylonian Method 

Babylonian method is used to calculate  square roots .

* Update numerical_methods/babylonian_method.cpp

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

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 9596ac79

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-11-07 10:36:08 -06:00
David Leal
5bfc7740c8
fix: remove the ms-vscode.cpptools extension 2021-11-05 18:39:50 -06:00
David Leal
f5f7824909
fix: Update Gitpod extensions (#1839) 2021-11-05 18:37:02 -06:00
Ameya Chawla
87ef61ae23
feat : Implemented Inverse Fast Fourier Transform (#1834)
* feat : Implemented Inverse Fast Fourier Transform

Slightly different from fast Fourier transform
Just the om variable declared in line 40 is divided by n
and swapping the testing inputs with testing outputs .

* Update numerical_methods/Inverse_fast_fourier_transform.cpp

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

* Update numerical_methods/Inverse_fast_fourier_transform.cpp

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

* Update numerical_methods/Inverse_fast_fourier_transform.cpp

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

* formatting filenames d7f9a946

* updating DIRECTORY.md

* fix : optimized the code

* Apply suggestions from code review

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Ayaan Khan <ayaankhan98@gmail.com>
2021-11-04 00:46:21 +05:30
ggkogkou
0c08cd75f9
feat: Created composite Simpson's numerical integration method (#1773)
* Created composite Simpson's numerical integration method

* Created midpoint numerical integration method

* Corrections

* deleted: unnecessary file

* fixed: doucumentation and structure

* Update numerical_methods/composite_simpson_rule.cpp

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

* Update numerical_methods/composite_simpson_rule.cpp

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

* Update numerical_methods/composite_simpson_rule.cpp

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

* Update numerical_methods/composite_simpson_rule.cpp

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

* Update numerical_methods/composite_simpson_rule.cpp

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

* Update numerical_methods/composite_simpson_rule.cpp

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

* Update numerical_methods/composite_simpson_rule.cpp

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

* Update numerical_methods/composite_simpson_rule.cpp

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

* Update numerical_methods/composite_simpson_rule.cpp

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

* updating DIRECTORY.md

* Update numerical_methods/composite_simpson_rule.cpp

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

* Update numerical_methods/composite_simpson_rule.cpp

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

* Update numerical_methods/composite_simpson_rule.cpp

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

* fixed: compilation and documentation error

Co-authored-by: ggkogkou <ggkogkou@ggkogkou.gr>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Ayaan Khan <ayaankhan98@gmail.com>
2021-11-03 12:22:08 -06:00
Alvin Philips
1f0eff28d0
fix: Circular linked list (#1825)
* Create reverse_binary_tree.cpp

* Added documentation

Added Documentation for the level_order_traversal() function, and implemented a print() function to display the tree to STDOUT

* Added documentation

* Renamed tests to test

* Fixed issue with incorrect using statement

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for fb86292d

* Added Test cases

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Changed int to int64_t

* Updated documentation wording

* Rewrote node struct and file structure

* Added Circular Linked List

* Update doc

* Wrote bulk of code, added documentation

* clang-format and clang-tidy fixes for 06f11f1e

* Update operations_on_datastructures/circular_linked_list.cpp

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

* Update operations_on_datastructures/circular_linked_list.cpp

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

* clang-format and clang-tidy fixes for 25ed3ea0

* Added parameter documentation

* Added destructor for CircularLinkedList

* Fixed memory bug

* Update circular_linked_list.cpp

* Update circular_linked_list.cpp

* Added move constructor and assignment operator

* clang-format and clang-tidy fixes for b36e4736

* Fixed copy and move operators/constructors and added documentation

* clang-format and clang-tidy fixes for 24d3b9c2

* Added missing returns

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>
2021-11-02 11:03:49 -06:00
Ameya Chawla
b4b0864da1
feat: Implemented Fast Fourier Transform algorithm (#1700)
* feat ; Implemented Fast Fourier Transform

* feat : Implemented Fast Fourier Transform

* fix : added comments to header

* Fixing Code Formatter errors

* fix : updated the documentation

* fix : removed bad practice of using namespace td

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* updating DIRECTORY.md

* fix : fixed the integer values with their appropriate size

* Fixed errors

* Update fast_fourier_transform.cpp

* Update fast_fourier_transform.cpp

* Fixed many errors

* fix : fixed array errors

* fix: fixing memory leak errors

* fix: using delete instead of free as mentioned in errors

* fix : using delete[ ] instead of delete

* fix : fixing errors for memory leaks

* Update fast_fourier_transform.cpp

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* clang-format and clang-tidy fixes for a6594c85

* fix : updated documentation

* fix : added time complexity in documentation

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* fix : update code as per the namespace numerical_methods

* fix : use of auto keyword to reduce complexity

* fix : updated documentation

* fix : fixed segmentation fault error

* fix : fixing clang-tidy errors

* fix : fixing clang-tidy errors

* Update fast_fourier_transform.cpp

* Update fast_fourier_transform.cpp

* Update fast_fourier_transform.cpp

* Update fast_fourier_transform.cpp

* Update fast_fourier_transform.cpp

* Update fast_fourier_transform.cpp

* Update fast_fourier_transform.cpp

* fix : updated documentation

* fix : fixing warnings

* Update fast_fourier_transform.cpp

* Update fast_fourier_transform.cpp

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* clang-format and clang-tidy fixes for 198b4297

* Update fast_fourier_transform.cpp

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* Update numerical_methods/fast_fourier_transform.cpp

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

* a

* Apply suggestions from code review

* fix : updating leak memeory

* Update fast_fourier_transform.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-11-02 10:52:18 -06:00
ggkogkou
8a6f2052e2
feat: Created midpoint integration numerical method (#1785)
* Created composite Simpson's numerical integration method

* Created midpoint numerical integration method

* Corrections

* Midpoint method

* Improved Documentation

* added namespace numerical_methods

* Update numerical_methods/midpoint_integral_method.cpp

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

* Update numerical_methods/midpoint_integral_method.cpp

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

* Update numerical_methods/midpoint_integral_method.cpp

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

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for ec5e0cce

* Update numerical_methods/midpoint_integral_method.cpp

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

* clang-format and clang-tidy fixes for 7f16cc14

* Update numerical_methods/midpoint_integral_method.cpp

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

* Update midpoint_integral_method.cpp

* All changes have been applied

* clang-format and clang-tidy fixes for 6617e060

* Update numerical_methods/midpoint_integral_method.cpp

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

* Update numerical_methods/midpoint_integral_method.cpp

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

* clang-format and clang-tidy fixes for a5a50f89

* Update numerical_methods/midpoint_integral_method.cpp

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

* clang-format and clang-tidy fixes for 4c60e180

* Create midpoint_integral_method.cpp

* Update numerical_methods/midpoint_integral_method.cpp

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

* clang-format and clang-tidy fixes for 27f76052

* Update midpoint_integral_method.cpp

Co-authored-by: ggkogkou <ggkogkou@ggkogkou.gr>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-11-01 07:56:40 -06:00
David Leal
1e8376eedb
fix: Update the CoC to match the .github repository (#1832) 2021-10-31 21:05:51 -06:00
Allen Guan
1f6c39bcf2
fix: rewrite prime numbers using linear sieve (#1810)
* fix: rewrite prime numbers using linear sieve

* fix code scanning error

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

* fix sign-compare warning

* clang-format and clang-tidy fixes for 6ddff0f7

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-10-31 17:47:16 -06:00
David Leal
4e3abd4601
[feat/fix/docs]: Improvements in the backtracking folder (#1553)
* [feat/fix/docs]: Improvements in the...

...`backtracking` folder, and minor fixes in the `others/iterative_tree_traversals.cpp` and the `math/check_prime.cpp` files.

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

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>
2021-10-29 13:05:46 -05:00
Tushar Mohan
a9312b3901
feat: a different implementation of checking bipartite-ness of a graph (#1769)
* feat: a different implementation of checking bipartite-ness of a graph

* updating DIRECTORY.md

* fix: code formatter error

* fix: requested changes

* fix: request changes

* fix : requested changed

* pass parameters by reference

* pass parameters by reference

* fix : visited to pointer

* fix : line length below 80 chars

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: Ayaan Khan <ayaankhan98@gmail.com>
2021-10-27 20:48:58 -05:00
Focus
050c99eb0a
feat: added math/volume.cpp (#1796)
* feat: added math/volume.cpp

* updating DIRECTORY.md

* fix: style guide

* fix: pi define to constexpr

* fix: changed PI definition to function param

* fix: style guide

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

* fix: style guide

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

* fix: added functions to math namespace

* [fix/docs]: initialized test variables and added docs

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: Ayaan Khan <ayaankhan98@gmail.com>
2021-10-26 13:19:58 +05:30
Alvin Philips
e5135d8bd8
fix: Array left rotation (#1792)
* Create reverse_binary_tree.cpp

* Added documentation

Added Documentation for the level_order_traversal() function, and implemented a print() function to display the tree to STDOUT

* Added documentation

* Renamed tests to test

* Fixed issue with incorrect using statement

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for fb86292d

* Added Test cases

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Changed int to int64_t

* Updated documentation wording

* Rewrote array_left_rotation

* Modified doc, fixed bug in shifting logic

Fixed a mistake that would cause the array to shift incorrectly

* clang-format and clang-tidy fixes for bd135686

* Update operations_on_datastructures/array_left_rotation.cpp

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

* changed int to size_t

* clang-format and clang-tidy fixes for 00e7daaf

* clang-format and clang-tidy fixes for ed2aa3a7

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>
2021-10-25 23:08:12 -05:00
Lajat5
b3a0070a74
feat: Reworked/updated sorting/selection_sort.cpp. (#1613)
* Reworked selection_sort.cpp with fixes.

* Added Recursive implementation for tree traversing

* Fix #2

* Delete recursive_tree_traversals.cpp

* Update selection_sort.cpp

* Changes done in selection_sort_iterative.cpp

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 4681e4f7

* Update sorting/selection_sort_iterative.cpp

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

* Update sorting/selection_sort_iterative.cpp

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

* Update selection_sort_iterative.cpp

* Update sorting/selection_sort_iterative.cpp

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

* Update sorting/selection_sort_iterative.cpp

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

* clang-format and clang-tidy fixes for ca2a7c64

* Finished changes requested by ayaankhan98.

* Reworked on changes.

* clang-format and clang-tidy fixes for f79b79b7

* Corrected errors.

* Fix #2

* Fix #3

* Major Fix #3

* clang-format and clang-tidy fixes for 79341db8

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

* Update selection_sort_iterative.cpp

* clang-format and clang-tidy fixes for 9833d7a7

* clang-format and clang-tidy fixes for b7726460

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>
2021-10-25 13:17:33 -05:00
Alvin Philips
4d884b0dc7
fix: Union of two arrays (#1797)
* Create reverse_binary_tree.cpp

* Added documentation

Added Documentation for the level_order_traversal() function, and implemented a print() function to display the tree to STDOUT

* Added documentation

* Renamed tests to test

* Fixed issue with incorrect using statement

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for fb86292d

* Added Test cases

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Changed int to int64_t

* Updated documentation wording

* Added reference to intersection of two arrays

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2021-10-25 11:05:11 -05:00
Focus
f3b59d173b
feat: added math/area.cpp (#1771)
* feat: added math/area.cpp

* feat: added surface area of sphere, cube and cylinder

* docs: modified @brief

* feat: changed to template functions

* test: added 2 test cases for square_area()

* test: added 3rd test case

* [test/docs] added more test cases and docs for them

* docs: added @details

* updating DIRECTORY.md

* fix: changed from math.h to cmath

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

* feat: added algorithms to the math namespace

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

* fix: call functions from the math namespace for testing

* fix: style indentation

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

* fix: style indentation

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

* feat: uses uint16_t instead of int for testing

* docs: added comments for testing variables

* fix: style guide

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

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2021-10-24 13:22:40 -05:00
Aayush Vyas
f821fae698
feat : add Class Based DSU for Path Compression O(1) & Union Rank O(logN) (#1571)
* Add files via upload

# Class Based DSU
-Using Path Compression to get the best time complexity O(1)
-Using Union Rank to keep track of changes using parent(p) O(logN)

* Class based DSU : Path Compression O(1) and Union Rank O(logN)

* made changes to satisfy the meets of the PR

changes made to satisfy the needs of the PR
- used base lib instead of <bits/stdc++.h>
- changed all stdin's and included pre-declared test cases

* removed stdin for testing

* changed file name from upper case to lower case

* made necessary changes

* Delete DSU_union_rank.cpp

* Delete DSU_path_compresssion.cpp

* added explicit to contructors, return 0, n=dec

* Delete dsu_path_compresssion.cpp

* added documentations, to match the typical structure

Added @brief @details @author @param @returns

* Update data_structures/dsu_union_rank.cpp

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

* Update data_structures/dsu_path_compression.cpp

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

* Update data_structures/dsu_path_compression.cpp

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

* Update data_structures/dsu_path_compression.cpp

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

* Update data_structures/dsu_union_rank.cpp

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

* Update data_structures/dsu_path_compression.cpp

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

* Update data_structures/dsu_path_compression.cpp

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

* added self-implementation test cases, changed int to uint64_t

* std::cout after assert

* Update data_structures/dsu_path_compression.cpp

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

* Update data_structures/dsu_union_rank.cpp

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

* Update data_structures/dsu_path_compression.cpp

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

* Update data_structures/dsu_path_compression.cpp

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

* Update data_structures/dsu_path_compression.cpp

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

* Update data_structures/dsu_path_compression.cpp

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

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for b8c37d09

* Update data_structures/dsu_path_compression.cpp

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

* Update data_structures/dsu_path_compression.cpp

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

* documentation changes

* Update dsu_union_rank.cpp

* Update data_structures/dsu_path_compression.cpp

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

* Update data_structures/dsu_path_compression.cpp

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

* Update data_structures/dsu_union_rank.cpp

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

* Update data_structures/dsu_path_compression.cpp

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

* Update data_structures/dsu_union_rank.cpp

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

* Update data_structures/dsu_union_rank.cpp

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

* clang-format and clang-tidy fixes for 18843179

* Update data_structures/dsu_path_compression.cpp

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

* Update data_structures/dsu_path_compression.cpp

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

* Update data_structures/dsu_union_rank.cpp

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

* clang-format and clang-tidy fixes for 5c24d9a9

* Update data_structures/dsu_union_rank.cpp

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

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>
Co-authored-by: Ayaan Khan <ayaankhan98@gmail.com>
2021-10-24 21:11:13 +05:30
Alvin Philips
5c9750d97b
fix: Intersection of two arrays (#1781)
* Create reverse_binary_tree.cpp

* Added documentation

Added Documentation for the level_order_traversal() function, and implemented a print() function to display the tree to STDOUT

* Added documentation

* Renamed tests to test

* Fixed issue with incorrect using statement

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for fb86292d

* Added Test cases

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Changed int to int64_t

* Updated documentation wording

* Reused code from union_of_two_arrays and modified for intersection

* Fixed bug and corrected test output

* Renamed file to better meet filename guidelines

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for e653f77a

* Changed integer type from int64_t to int32_t

* Added reference to similar union_of_two_arrays file

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>
2021-10-24 20:49:27 +05:30
Alvin Philips
b8d0c34126
fix: Array right rotation (#1793)
* Create reverse_binary_tree.cpp

* Added documentation

Added Documentation for the level_order_traversal() function, and implemented a print() function to display the tree to STDOUT

* Added documentation

* Renamed tests to test

* Fixed issue with incorrect using statement

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for fb86292d

* Added Test cases

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Changed int to int64_t

* Updated documentation wording

* Rewrote array_right_rotation by modifying code from array_left_rotation

* Minor documentation changes

* clang-format and clang-tidy fixes for 16672f02

* Update operations_on_datastructures/array_right_rotation.cpp

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

* Changed int to size_t

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2021-10-24 14:20:34 +05:30
Alvin Philips
51e1dda02e
fix: Union of two arrays (#1794)
* Create reverse_binary_tree.cpp

* Added documentation

Added Documentation for the level_order_traversal() function, and implemented a print() function to display the tree to STDOUT

* Added documentation

* Renamed tests to test

* Fixed issue with incorrect using statement

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for fb86292d

* Added Test cases

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Changed int to int64_t

* Updated documentation wording

* Fixed wrong integer type

Changed int64_t to int32_t

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

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2021-10-23 19:48:26 -05:00
OM GUPTA
6c6747174c
feat: updated the Prime number checking code to make it more efficient (#1714)
* updated the code to make it more efficient

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Apply suggestions from code review

Co-authored-by: David Leal <halfpacho@gmail.com>
2021-10-22 17:07:33 +05:30
Focus
5b78538570
feat: added a1z26 cipher (#1775)
* feat: added a1z26 cipher

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 6e5b6be0

* Update ciphers/a1z26_cipher.cpp

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

* clang-format and clang-tidy fixes for 36edde81

* fix: brace style

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

* [feat/fix]: uses uint8_t for maps instead of int

* clang-format and clang-tidy fixes for ef211d41

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2021-10-22 11:18:41 +05:30
Alvin Philips
00b4406bc5
fix: Union of two arrays (#1770)
* Create reverse_binary_tree.cpp

* Added documentation

Added Documentation for the level_order_traversal() function, and implemented a print() function to display the tree to STDOUT

* Added documentation

* Renamed tests to test

* Fixed issue with incorrect using statement

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for fb86292d

* Added Test cases

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Changed int to int64_t

* Updated documentation wording

* Added namespace and print function

Added the operations_on_datastructures namespace and created a function to print a vector.

* Added implementation of union for two arrays

* Fixed bug with initialization of indexes and added test case

* Added test cases

* Modified references to const &

* Renamed file to meet filename guidelines better

* updating DIRECTORY.md

* Update operations_on_datastructures/union_of_two_arrays.cpp

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

* Update operations_on_datastructures/union_of_two_arrays.cpp

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

* Update operations_on_datastructures/union_of_two_arrays.cpp

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

* Made changes to documentation

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2021-10-21 14:21:39 -05:00
Alvin Philips
8ae862730f
fix: Missing period in the CONTRIBUTING.md file (#1772)
Missing period at the end of sentence
2021-10-20 15:13:35 -05:00
Alvin Philips
3406be6d0b
feat: Add Reverse a Binary Tree implementation (#1767)
* Create reverse_binary_tree.cpp

* Added documentation

Added Documentation for the level_order_traversal() function, and implemented a print() function to display the tree to STDOUT

* Added documentation

* Renamed tests to test

* Fixed issue with incorrect using statement

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for fb86292d

* Added Test cases

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Update operations_on_datastructures/reverse_binary_tree.cpp

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

* Changed int to int64_t

* Updated documentation wording

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2021-10-19 16:53:07 -05:00
Focus
692135b480
feat: added atbash cipher (#1760)
* feat: add atbash_cipher

* [test/fix]: test case expected result

* docs: added comments for main and test function

* doc: changed brief for test function

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

* updating DIRECTORY.md

* doc: fixed test comment

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

* [feat/fix]: made test function static

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

* doc: added author comment

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

* fix: brace style

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

* doc: modified file description and added comments for test function

* doc: added comment for #include <iostream>

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

* doc: added description of the algorithm

* Update ciphers/atbash_cipher.cpp

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

* Update ciphers/atbash_cipher.cpp

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

* Update ciphers/atbash_cipher.cpp

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

* Update ciphers/atbash_cipher.cpp

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

* fix: Apply suggestions from code review

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-10-18 19:54:00 -05:00
Soham Roy
61cbc630c3
fix: max length of arrays and coding style (#1614)
* Fixed array max length and coding style

Max length of arrays was previously an absurdly high integer, instead implemented a numerical upper bound using log2 (max depth of seg tree being logn). Removed `using namespace std;` and `typedef long long ll;` and other competitive coding practices. Added input prompts.

* Fixed remaining clang-tidy warnings

* Replaced reference parameters with const & or *

* Self-tests and documentation

* Improved documentation

* Added author names

Co-authored-by: David Leal <halfpacho@gmail.com>
2021-10-18 10:08:42 -05:00
Tushar Mohan
72e88b30cd
feat : Implementation of stack using queue with C++ STL (#1719)
* implementation of stack using queue with C++ STL

* fix: documentation + code formatting

* updating DIRECTORY.md

* fix: changes asked

* fix : made the required changes

* fix : required changes

* fix : -is on line 38

* fix : requested changes:

* fix : self-tests added

* fix: structure of tests

* fix : requested changes

* fix : requested changes

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: RahulSethi070801 <55681359+RahulSethi070801@users.noreply.github.com>
2021-10-18 09:42:16 -05:00
Prashant Thakur
6272b2af08
feat: Modified count_set_bits.cpp (#1634)
* Modified: Replaced existing code with faster implementation

* Changed long long to "int64_t"

* Indentation Fixed.

* Modified Documentation.

* Updated authors of count_set_bits.cpp

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

* Apply suggestions from code review

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

* Added proper indentation in "main" function

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

Co-authored-by: David Leal <halfpacho@gmail.com>
2021-10-16 19:57:23 -05:00
Domenic Zingsheim
27f1ed312f
feat: Add integral approximation using Monte Carlo Integration (#1742)
* feat: Add monte carlo integration

* test: Add tests for monte carlo integration

* docs: Add documentation for monte carlo integration

* updating DIRECTORY.md

* fix: Add _USE_MATH_DEFINES for windows

* fix: Comment spacing

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

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2021-10-15 20:34:15 -05:00
AlternateWalls
a9882e6f25
[feat/fix/docs]: Improve the Easter Determination algorithm (#1675)
* Create easter.cpp

* Update easter.cpp

* Update easter.cpp

* Update easter.cpp

* Update others/easter.cpp

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

* Update others/easter.cpp

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

* Update others/easter.cpp

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

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for f8e4e3fb

* Update others/easter.cpp

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

* Update others/easter.cpp

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

* Update others/easter.cpp

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

* Update others/easter.cpp

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

* Update others/easter.cpp

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

* Update others/easter.cpp

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

* clang-format and clang-tidy fixes for aae0d475

* Update easter.cpp

* Update easter.cpp

* clang-format and clang-tidy fixes for e033f98f

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-10-15 14:05:54 -05:00
Pratyush219
95ed72a452
feat: Added implementation of FCFS CPU scheduling algorithm (#1684)
* FCFS scheduling algorithm in operating system
Added C++ implementation of FCFS scheduling algorithm in a new directory Operating-System/Scheduing-Algorithms

* Renamed files and directories to match guidelines

* Updated comments

* Added comments for member variables of FCFS class

* Deleted .vscode directory

* Replaced array of tuples with vector of tuples
Replaced formatted printf with cout and iomanip flags
Removed unused code blocks

* Replaced array of tuples with vector of tuples

* Removed nested directory

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for c95495b4

* clang-format and clang-tidy fixes for 732f247d

* Updated the documentation and used unsigned int for non-negative integers

* clang-format and clang-tidy fixes for 295f0cc6

* clang-format and clang-tidy fixes for 31f05910

* Added test cases using random number generator

* Replaced time(0) with time(nullptr)

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

* Fixed documentation

* Rearranged code

* clang-format and clang-tidy fixes for b40a2801

* clang-format and clang-tidy fixes for 243dcc15

* Updated documentation

* clang-format and clang-tidy fixes for 899ff7ea

* Fixed some typos

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Replaced int with uint32_t in lines 259 and 263

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2021-10-15 11:34:00 -05:00
Paulo Vitor Lima Borges
bbec149f6d
feat: add prefix sum array data structure (#1663)
* feat: add prefix sum array data structure

* feat: add prefix_sum_array data structure

* updating DIRECTORY.md

* feat: Add Prefix Sum Array datastructure

* feat: Add Prefix Sum Array data structure

* Update range_queries/prefix_sum_array.cpp

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

* Update prefix_sum_array.cpp

* Update prefix_sum_array.cpp

* Update range_queries/prefix_sum_array.cpp

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

* Update range_queries/prefix_sum_array.cpp

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

* Update range_queries/prefix_sum_array.cpp

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

* Update range_queries/prefix_sum_array.cpp

* Update range_queries/prefix_sum_array.cpp

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2021-10-15 11:17:10 -05:00
Abhijeet Tiwari
2292606989
feat: kadane's algorithm added (#1669)
* feat: kadane's algorithm added

* file renamed to kadanes3.cpp and clang-tidy warnings fixed

* updating DIRECTORY.md

* DIRECTORY.md and kadanes3.cpp modified

* change integer types to int64_t and uint64_t, as per the requirements.

* clang-format and clang-tidy fixes for 5025b93a

* Apply suggestions from code review

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2021-10-15 11:15:53 -05:00
Anuran Roy
85721be69b
feat: Modify search/text_search.cpp (#1662)
* Modified search/text_search.cpp

* Added tests

* Added a few test cases

* Added a few more test cases and documentation

* Minor fix

* Minor fixes

* Minor fixes

* Minor output fixes

* Minor output fixes

* Minor readability fixes

* clang-format and clang-tidy fixes for a01765a6

* Restored original settings

* clang-format and clang-tidy fixes for 6a8f3a4e

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2021-10-14 13:34:55 -05:00
Domenic Zingsheim
5a654fb85b
feat: add geometric distribution (#1699)
* feat: add geometric distribution

* test: Add test for geometric dist

* fix: Make range_tries inclusive

* docs: Add documentation for geometric distribution

* fix: clang warnings in geometric_dist

* updating DIRECTORY.md

* fix: Remove extra line

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

* fix: Remove file name

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

* fix: Add return value of void function

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

* fix: Add comment for test function

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

* fix: Update successful test message

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

* fix: Add geometric_dist namespace

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

* fix: Remove extra line

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

* fix: Close comment

* docs: Fix documentation

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

* fix: Add const to parameter

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

* fix: Make class methods const

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2021-10-13 16:22:32 -05:00