Commit Graph

1732 Commits

Author SHA1 Message Date
mjk22071998
9772468f6e initial commit of Binary Addition 2024-10-07 19:01:23 +05:00
Muhammad Junaid Khalid
481e5dbb87 Merge branch 'TheAlgorithms:master' into master 2024-10-07 18:49:17 +05:00
Muhammad Junaid Khalid
dd36279e73 feat: Digit Separation Algorithm added (#2759)
* Digit Separation Algorithm added

* feat: Added namespace greedy_algoriithms

* "Updated digit separation code: added comments and docstrings, changed data types to std::int64_t, and reformatted code."

* feat: Made test function and removed extra whitespaces

* removed some more whitespaces

* Update greedy_algorithms/digit_separation.cpp

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

* fix: terminate multiline comment

* Update greedy_algorithms/digit_separation.cpp

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

* Update greedy_algorithms/digit_separation.cpp

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

* Update greedy_algorithms/digit_separation.cpp

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

* Update greedy_algorithms/digit_separation.cpp

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

* Corrected test function

* Update greedy_algorithms/digit_separation.cpp

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

* Update greedy_algorithms/digit_separation.cpp

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

* remove redundant declaration

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

* Corrected tests

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

* file clang linted

* "Moved method implementations from outside to inside class definition"

* fowardOrder to forwardOrder on line 122

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

* Removed Class scope resolution form digitSeparationReverseOrder function

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

* Removed Class scope resolution form digitSeparationForwardOrderfunction

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

* docs: documentation updated

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-07 19:09:23 +05:30
realstealthninja
cffb85a033 Merge branch 'master' into master 2024-10-07 19:04:40 +05:30
deDSeC00720
821d20c33a feat: LFU (Least frequently used) cache (#2757)
* feat: add lfu cache

* docs: add comments and explanation to class LFUCache

* test: add tests for class lfu cache

* docs: document namespace and classes

* test: modify tests to check negative numbers

* docs: document template params and class data members

* test: make test func static and move tests in the same func

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-07 19:02:52 +05:30
Nguyen Phuc Chuong
fddedd8864 fix: Adding documentations, tests, and amending algorithm for gcd_of_n_numbers.cpp (#2766)
* Update gcd_of_n_numbers.cpp

* Update gcd_of_n_numbers.cpp

Reformatting code, comment and test cases, change array data type.

* Update gcd_of_n_numbers.cpp

* Update gcd_of_n_numbers.cpp

* Update gcd_of_n_numbers.cpp

* Update gcd_of_n_numbers.cpp
2024-10-07 18:56:25 +05:30
realstealthninja
6c8305b8b8 Merge branch 'master' into master 2024-10-07 18:52:16 +05:30
Harshil Shah
b957b1dfef feat: Add hemi-sphere area algorithm (#2767)
* Add area of hemi-sphere

* Update math/area.cpp

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

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-07 06:15:29 +05:30
mjk22071998
c9cd9a341f Merge branch 'master' of https://github.com/mjk22071998/C-Plus-Plus 2024-10-06 08:22:48 +05:00
mjk22071998
28f690187a docs: documentation updated 2024-10-06 08:22:44 +05:00
Muhammad Junaid Khalid
12d8d53bd6 Removed Class scope resolution form digitSeparationForwardOrderfunction
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-06 08:03:36 +05:00
Muhammad Junaid Khalid
40ac10334d Removed Class scope resolution form digitSeparationReverseOrder function
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-06 08:03:14 +05:00
Muhammad Junaid Khalid
ba56880806 fowardOrder to forwardOrder on line 122
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-06 08:02:08 +05:00
mjk22071998
3f0489232d "Moved method implementations from outside to inside class definition" 2024-10-06 07:53:29 +05:00
Muhammad Junaid Khalid
051448f7d0 Merge branch 'master' into master 2024-10-06 07:40:19 +05:00
github-actions[bot]
f9fb58fb87 docs: update DIRECTORY.md (#2771)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-06 08:09:04 +05:30
Muhammad Junaid Khalid
a0f488b0cc Merge branch 'master' into master 2024-10-06 07:34:51 +05:00
mjk22071998
14274747bd file clang linted 2024-10-06 07:31:37 +05:00
Amine Ghoussaini
60093d70ab feat: add duval's algorithm (#2725)
* feat: Add Duval's algorithm for the lexicographically smallest rotation in a sequence.

* fixes.

* fixes.
2024-10-05 18:22:02 +05:30
Muhammad Junaid Khalid
ef954a8673 Corrected tests
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-05 17:22:37 +05:00
Muhammad Junaid Khalid
a585834c95 remove redundant declaration
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-05 17:22:04 +05:00
Muhammad Junaid Khalid
87b955b831 Update greedy_algorithms/digit_separation.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-05 16:49:36 +05:00
Muhammad Junaid Khalid
18b65460e0 Update greedy_algorithms/digit_separation.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-05 16:49:24 +05:00
mjk22071998
af077d2494 Corrected test function 2024-10-05 16:46:15 +05:00
Muhammad Junaid Khalid
373e1df601 Update greedy_algorithms/digit_separation.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-05 16:44:09 +05:00
Muhammad Junaid Khalid
5f392b9960 Update greedy_algorithms/digit_separation.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-05 16:43:43 +05:00
Muhammad Junaid Khalid
ad034743ea Update greedy_algorithms/digit_separation.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-05 16:43:28 +05:00
Muhammad Junaid Khalid
1fb86dbe99 Update greedy_algorithms/digit_separation.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-05 16:41:43 +05:00
realstealthninja
d3edb52ebe fix: terminate multiline comment 2024-10-05 17:09:48 +05:30
Muhammad Junaid Khalid
cba0eb9603 Update greedy_algorithms/digit_separation.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-05 16:38:55 +05:00
mjk22071998
9c0034c50f removed some more whitespaces 2024-10-05 16:24:01 +05:00
mjk22071998
57f61a6760 feat: Made test function and removed extra whitespaces 2024-10-05 16:21:49 +05:00
mjk22071998
76edb15be4 "Updated digit separation code: added comments and docstrings, changed data types to std::int64_t, and reformatted code." 2024-10-05 12:32:23 +05:00
mjk22071998
011c4e2d80 feat: Added namespace greedy_algoriithms 2024-10-05 10:33:58 +05:00
Muhammad Junaid Khalid
48f42a73ce Merge branch 'TheAlgorithms:master' into master 2024-10-05 10:14:52 +05:00
mjk22071998
47af70eb68 Digit Separation Algorithm added 2024-10-05 10:13:16 +05:00
jiya
0ecb6bd28a docs: reword binary search (#2752)
* Update binary_search.cpp

making some correction in the theory of binary search

* Update search/binary_search.cpp

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

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-05 08:08:23 +05:30
github-actions[bot]
51be6aad33 docs: update DIRECTORY.md (#2754)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-04 23:52:19 +05:30
Divyansh-jain2
c56496d9f2 chore: use M_PI instead of PI parameter (#2747)
* changed PI variable value from 3.14 to M_PI

* changed PI variable to M_PI

* changed the degree_to_radians function

* comments removed

* docs: remove pi param

* fix: typo in function name

* changed degree to degrees

---------

Co-authored-by: [Divyansh Jain] <[jdivyansh51@gmail.com]>
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-04 22:33:44 +05:30
B Karthik
901f231d59 feat: Added gale_shapley.cpp in greedy_algorithms (#2743)
* Added gale_shapley.cpp in greedy_algorithms

* Added gale_shapley.cpp in greedy_algorithms

* Genralized GaleShapley with reviewed change

* fix: added description

* fix: fixed nameing of namespace

* fix: reviewed changes

* fix: reviewed changes

* TestCase Empty vector

* function description

* Update greedy_algorithms/gale_shapley.cpp

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

* Update greedy_algorithms/gale_shapley.cpp

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

* Change type

* typechange with header documentation

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-10-04 18:48:54 +05:30
Nguyen Phuc Chuong
cde1672dca feat: Create gray_code.cpp (#2750)
* Create gray_code.cpp

* Update gray_code.cpp

Remove extra lines, add bit_manipulation and gray_code namespaces, add negative number test
2024-10-04 18:39:03 +05:30
Piotr Idzik
f789e3bb9e style: cleanup catalan_numbers.cpp (#2740)
* style: cleanup `catalan_numbers.cpp`

* docs: update file level docs

* style: use `std::transform_reduce`
2024-09-29 19:24:02 +05:30
Piotr Idzik
9374b00319 style: add missing const in median_search2.cpp (#2734) 2024-09-17 21:54:35 +05:30
Piotr Idzik
a0b7dee79e style: lint huffman.cpp (#2733) 2024-09-15 14:24:44 +05:30
Piotr Idzik
8df7a884f5 fix: remove memory leak from circular_queue_using_linked_list.cpp (#2731) 2024-09-14 05:09:03 +05:30
Monalisa0311
920b6d4e81 Added test cases in greedy_algorithms\kruskals_minimum_spanning_tree.cpp (#2727)
* Added test cases in greedy_algorithms\kruskals_minimum_spanning_tree.cpp

* Update kruskals_minimum_spanning_tree.cpp

test case1 & 2 changed

* Update kruskals_minimum_spanning_tree.cpp

test-case1 changed

* Update kruskals_minimum_spanning_tree.cpp

All test case formatting changes

* Update kruskals_minimum_spanning_tree.cpp

unit-32 test case added

* Update kruskals_minimum_spanning_tree.cpp

added new line

* Update kruskals_minimum_spanning_tree.cpp

Formatting changed

* Update kruskals_minimum_spanning_tree.cpp

move infinity valued inside test

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-09-13 12:23:29 +05:30
Piotr Idzik
b169269c94 fix: remove memory leak from reverse_binary_tree.cpp (#2730) 2024-09-13 08:02:43 +05:30
Piotr Idzik
7828b8e238 fix: memory leak in morrisinorder.cpp (#2729) 2024-09-12 05:00:09 +05:30
Piotr Idzik
d74f4d33ea fix: memory leak in huffman.cpp (#2728) 2024-09-11 06:55:42 +05:30
Piotr Idzik
15e3fed924 style: add missing const in bloom_filter.cpp (#2724)
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-09-05 05:24:16 +05:30