Commit Graph

232 Commits

Author SHA1 Message Date
github-actions[bot]
f49369065c
docs: update DIRECTORY.md (#2521)
Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
2023-09-06 11:35:38 -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
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
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
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
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
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
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
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
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
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
David Leal
1371b5390a
[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
2022-12-01 11:29:28 -06:00
David Leal
d0f7f230ca
fix: use FreeGlut newest GitHub link (#2397)
* updating DIRECTORY.md

* fix: use FreeGlut newest GitHub link
2022-11-23 22:17:17 -06:00
Focus
0fea073413
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>
2022-10-26 03:01:34 +05:30
weiss-ben
1645cf281f
feat: add new Median Search implementation (#1992)
* feat: add new median search algorithm with linked list

* Removed filename

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

* Update search/median_search2.cpp

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

* Update search/median_search2.cpp

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

* Update search/median_search2.cpp

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

* Update search/median_search2.cpp

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

* fix: Requested changes made

* Update search/median_search2.cpp

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

* Update search/median_search2.cpp

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

* Update search/median_search2.cpp

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

* Added algorithm and implementation explanations. Also added wikipedia link.

* Update search/median_search2.cpp

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

* Added @brief and wikipedia link to algo

* Update search/median_search2.cpp

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

* moved includes to top of file

* fix: clang-tidy fixes applied

* fix: clang-tidy fixes

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for b24ca86e

* Update search/median_search2.cpp

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

* clang-format and clang-tidy fixes for 247e0616

* fix: fixed test case failing

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

* fix: test cases now pass

* clang-format and clang-tidy fixes for f3027971

* Update search/median_search2.cpp

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

* Update search/median_search2.cpp

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

* clang-format and clang-tidy fixes for b8b5f5fd

* clang-format and clang-tidy fixes for d67d450c

Co-authored-by: David Leal <halfpacho@gmail.com>
2022-09-26 11:28:55 -05:00
DanArmor
eae5a72561
feat: add Bloom Filter to data_structures (#1953)
* feat: add bloom_filter.c(bloom filter and bitset for it)

* updating DIRECTORY.md

* docs: add comments to bloom_filter

* test: add tests and minor fixes

* docs: more common docs

* fix: clang-tidy warnings fix

* fix: clang-forma - minor fixes

* fix: line-space and better naming in hashStr

* updating DIRECTORY.md

* fix: apply suggestions from code review

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

* fix: test_bitset was moved before main. Changed description for template T parameter

* Apply suggestions from code review

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

* fix: namespace fix

* fix: minor style fix

* Apply suggestions from code review

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

* fix: params names was removed from prototypes

* Update data_structures/bloom_filter.cpp

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

* docs: minor improvements/fixes

Co-authored-by: David <Panquesito7@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2022-09-13 11:04:06 -05:00
David Leal
0594923efa
feat: add the bit_manipulation directory to CMake (#1991)
* feat: add `bit_manipulation` to CMake

* updating DIRECTORY.md
2022-09-10 19:43:55 -05:00
David Leal
ca5776763f
fix: Graph Coloring algorithm filename (#1982)
* fix: Graph Coloring algorithm filename

* updating DIRECTORY.md
2022-08-11 13:41:41 -05:00
Carlos Rafael
274cab6914
feat: add modular_inverse_simple (#1937)
* fix: power_of_two algorithm redundant conditional 'else'

* feat : add modular_inverse_simple

* updating DIRECTORY.md

* fix : according lint rules

* fix : removed macro and initialize variable aux

* fix: remove namespace std like default

* feat : add unsigned type for block negative number and improving description

* fix: defined in header <cstdint> for use uint64_t type

* fix: improving descriptive comments

* fix: remove redundant lib

* fix: improvinf "brief" and "details" acording suggestion in review

* fix: improving descrition of function imod acording suggestion in review

* fix: improving descrition acording suggestion in review

* Update modular_inverse_simple.cpp

* Apply suggestions from code review

* clang-format and clang-tidy fixes for 768a99c8

* Apply suggestions from code review

* Apply suggestions from code review

* updating DIRECTORY.md

Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2022-06-09 10:27:12 -05:00
Mohammad Islam
c1a9019d2a
feat: add perimeter.cpp (#1897)
* Create velocity.cpp

* changed of source file

* changed on perimeter.cpp

* Created perimeter.cpp

* Final

* Testing

* Delete perimeter

* Deleted perimeter

* created perimeter.cpp

* Update perimeter.cpp

* Update math/perimeter.cpp

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

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 5389d9f0

* Update math/perimeter.cpp

Co-authored-by: Ayaan Khan <ayaankhan98@gmail.com>

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David <Panquesito7@users.noreply.github.com>
Co-authored-by: Ayaan Khan <ayaankhan98@gmail.com>
2022-02-02 11:02:02 +05:30
Aman Raj
53a6c16730
added set_kth_bit.cpp (#1863)
* added set_kth_bit.cpp

* updating DIRECTORY.md

* Update bit_manipulation/set_kth_bit.cpp

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

* Update bit_manipulation/set_kth_bit.cpp

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

Co-authored-by: David <Panquesito7@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2022-01-16 21:27:24 +05:30
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
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
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
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
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
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
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
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
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
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
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
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
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