Commit Graph

107 Commits

Author SHA1 Message Date
Nishant Chatterjee
1a1570d775
feat: Segment Tree Data Structure (#2444)
* Segment Tree

* fix: conformed to guidelines

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

* fix: suggested changes

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

* fix: suggested changes

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

* fixed: suggested changes

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

* fix: suggested changes

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

* fix: suggested changes

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

* fix: suggested changes

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

* fix: suggested changes

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

* fix: suggested changes

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

* fix: suggested changes

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

* fix: remove duplicate line

* Update segment_tree.cpp

* chore: apply suggestions from code review

---------

Co-authored-by: David Leal <halfpacho@gmail.com>
2023-04-28 08:43:22 -06:00
Piotr Idzik
65efd47bc1
fix: remove memory leak in reverse_a_linked_list.cpp (#2439)
* style: remove unused header

* fix: add destructor to list

* style: add missing constructors, make some methods const

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

* fix: suppress some warnings

* docs: remove meaningless documentation

* docs: add missing documentation

* style: check if isEmpty in copy_all_nodes_from_list

* style: declare variables in seperate lines

Co-authored-by: David Leal <halfpacho@gmail.com>
2023-03-30 14:19:26 -06:00
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
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
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
8cc4433050
chore(fix): data_strcutres -> data_structures (#2399) 2022-11-25 18:49:18 -06:00
Chen Tao
1772ee06cc
fix: ARM GCC compiler error (#1952)
Co-authored-by: David Leal <halfpacho@gmail.com>
2022-09-27 12:24:33 -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
Bikash Daga (Jain)
60fc753f7f
docs: add another link for BST (#1960)
* Added one Useful Link

Have Added Scaler Topics Binary Search Tree (BSTs) Page. Kindly Please check the suggested changes. Hope this contribution helps

* chore: apply suggestions from code review

* chore: make the line shorter

Co-authored-by: David Leal <halfpacho@gmail.com>
2022-09-09 18:31:28 -05:00
Maximous Black
db149bf3b7
fix: fix overflow check in data_structures/list_array.cpp (#1983)
* fix(list_array): fix overflow check

+ use template for list size

* Update data_structures/list_array.cpp

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

Co-authored-by: David Leal <halfpacho@gmail.com>
2022-09-02 09:28:13 -05:00
Tanisha Belkar
543d6e0135
chore: add exit as an option in the... (#1931)
...Linked List file algorithm.

* Bug: Added exit condition to the linked list menu

* revert back

* fix: added exit condition to the linked list display menu

* update

Co-authored-by: David Leal <halfpacho@gmail.com>
2022-02-01 23:34:52 -06:00
rynrin
5074ed296b
fix: a typo in data_structures/linked_list.cpp (#1843) 2021-11-14 00:33:16 -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
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
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
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
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
Urwashi Kumrawat
2e6b71e206
feat: Adding switch-case and removing if-else-if (#1727)
* Adding switch-case and removing if-else-if

* [feat/fix]: Update

Co-authored-by: David Leal <halfpacho@gmail.com>
2021-10-12 12:49:39 -05:00
Tisha Soumya
f7a5aecce5
feat: Add reverse linked list algorithim (#1596)
* add: reverse linked list algorithim

* updating DIRECTORY.md

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

* Update data_structures/reverse_a_linked_list.cpp

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

* Update data_structures/reverse_a_linked_list.cpp

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

* Update the description in data_structures/reverse_a_linked_list.cpp

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

* clang-format and clang-tidy fixes for 19b4a937

* Updating data_structures/reverse_a_linked_list.cpp

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

* add:test for the reversing algorithim

* fix: synatx changes

* docs :added an external link for explanation of the algorithim

* fix: suggested changes

* fix: chamges in the code

* docs : changes required in the docs

* docs :fix indentation

* fix : ouptut statement changes

* fix: clang-tidy warnings

* formatting filenames f7695035

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for f7695035

* fix : display function removed

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 38547be2

* fix: changed the data types

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

* docs : documentation fixes

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

* docs : documentation changes

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

* clang-format and clang-tidy fixes for 57953be1

* docs: fix changes

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

* clang-format and clang-tidy fixes for db8e74a9

* fix : display changes

Co-authored-by: ERR ! <75872316+amino19@users.noreply.github.com>

* fix : added try block

* fix: try-catch block

* fix :merge conflict

* docs:documentation changes

* added more efficient test cases

* clang-format and clang-tidy fixes for 83ee6e44

* Update data_structures/reverse_a_linked_list.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>
Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>
Co-authored-by: ERR ! <75872316+amino19@users.noreply.github.com>
2021-09-26 19:03:53 -05:00
Mann Patel
17405a05ee
feat: add spare table data structure (#1502)
* feat: add spare table data structure

Added implementation of sparse table for a 'duplicate invariant function'. Implementation of min(a1,a2...,aN) being the duplicate invariant function is done.

* fixed: clang-tidy warnings

* minor change: remove bits/stdc++ header

* added header comments

* updating DIRECTORY.md

* fixed to clang-format

* fixed header postion

suggested change

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

* fixed author name

suggested changes

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

* fixed test() info to Doxygen standards.

suggested changes

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

* changed comment

suggested changes

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

* minor changes in file info

suggested changes

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

* minor changes in file info

suggested changes

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

* minor changes in file info

suggested changes

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

* changes in variable and struct descriptions

* Update data_structures/sparse_table.cpp

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

* Update data_structures/sparse_table.cpp

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

* Update data_structures/sparse_table.cpp

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

* changed int data type for non-negative numbers

* changing datatypes of certain variables

* Update data_structures/sparse_table.cpp

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

* Update data_structures/sparse_table.cpp

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

* clang-format and clang-tidy fixes for ddf777fc

* minor changes

* fixed comparison of integer of diff signedness

* Update data_structures/sparse_table.cpp

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

* added description as @Panquesito7 suggested

* minor grammar checks

* minor documentation fixes

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-06-07 15:24:49 -05:00
GeorgianaK
5ba8bc2c86
read violation resolved (#1496) 2021-05-25 10:52:52 +05:30
Bolaji Boluwatife
a5022c53f2
fix: Corrected erase method in data_structures/linked_list.cpp (#1494) 2021-05-09 22:24:05 -05:00
Venkata Bharath Malapati
7ea1ca6c9c
feat: Trie data structure using hashmap, predict_words method, class Trie (#1464)
* feat: add Trie data structure using hashmap, predict_words method, class Trie

* updating DIRECTORY.md

* fix: fixed clang.tidy warnings

* docs: added documentation toclass trie

* docs: updated documentation

* fix: added namespace trie_using_hashmap

* docs: updated documentation with comments

* docs: updated documentation with spelling corrections

* docs: updated requested changes

* docs : updated requested changes in documentation

* 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>
2021-03-18 23:58:33 +05:30
David Leal
d970011d3d
fix: LGTM warnings in...
...`data_structures/rb_tree.cpp`.
2021-03-07 21:19:21 -06:00
David Leal
f71fbc54d7
fix: Move rb_tree.cpp to its correct director...
...y and fix filename.
2021-03-04 21:33:27 -06:00
Walt
6b4d6c20ff
feat: add new implementation of binary search tree (#1208)
* fix: revamp binary_search_tree.cpp to use generics, oop, and modern c++ features

* fix: remove make_unique from code

* fix: fix some clang-tidy errors in binary_search_tree.cpp

* Move new implementation into new file, restore old file.

* Reset binary_search_tree.cpp to original implementation.

* Add link to new implementation.

* fix: add suggested fixes (see PR)

* Implement comment suggestions.

* Update data_structures/binary_search_tree2.cpp

Co-authored-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>

* Fix additional comments.

Co-authored-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
2021-02-05 15:37:16 +05:30
Sagar Pandya
e813f9b2a6
[docs/test]: Documentation and test in the list_array.cpp (#1375)
* Added introductory documentation in list_array

* documentation for search completed, minor bug fixed in the list_array

* bug fixed in the insert method

* edge case check added in the remove method

* Documentation completed in list_array

* Testing completed in the list_array.cpp

* Bug fixed in the sort method

* test cases improved and minor bug fixed in list_array

* minor allignment changed

* changes in documentation and improvement in the code in list_array

* resolve clang-tidy warning

* link added datatype changed

* namespaces added

* minor documentation changed in list_array.cpp

Co-authored-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
2021-02-05 15:35:44 +05:30
fedom
9d3d40b44e
feat: add 2-3-4-tree implment (#1366)
* feat: add 2-3-4 tree implment

* updating DIRECTORY.md

* docs: fix format issue of tab&space

* fix: fix code format issues

* fix: convert printf() to std::cout

* fix: fix some clang-tidy warnings

* fix: fix clang-tidy warnings of memory owning

* fix: remove use of  std::make_unique which is not support by c++11

* docs: improve documents

* fix: replace fprint with ofstream, and improve docs

* docs: improve docs for including header file

* docs: improve file doces

* fix: convert item type to int64_t, convert node item count type to int8_t

* refactor: Apply suggestions from code review

Add namespaces

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

* docs: remove obsolete comments

Co-authored-by: liuhuan <liuhuan@ainirobot.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2020-12-01 11:16:49 +05:30
Kaustubh Damania
67e26cfbae
feat: Add ncr mod p code (#1325)
* feat: Add ncr mod p code (#1323)

* Update math/ncr_modulo_p.cpp

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

* Added all functions inside a class + added more asserts

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for f6df24a5

* Replace int64_t to uint64_t + add namespace + detailed documentation

* clang-format and clang-tidy fixes for e09a0579

* Add extra namespace + add const& in function arguments

* clang-format and clang-tidy fixes for 8111f881

* Update ncr_modulo_p.cpp

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

* Update math/ncr_modulo_p.cpp

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

* Update math/ncr_modulo_p.cpp

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

* Update math/ncr_modulo_p.cpp

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

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

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for a8401d4b

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-11-22 23:05:01 +05:30
Farbod Ahmadian
b4b182a61d
[fix/docs]: Memory leakage caused by using new operator & refactoring/documentation (#1428)
* fix: Fixed memory leak bug by using 'std::vector' instead of 'new'

* Small refactoring

* Small refactoring

* Fix Code Formatter test failed

* Code refactored based on PR review

* Added return 0 based on PR review

* docs: Added documentation for linear queue using array implementation

* docs: Updated based on PR review

* docs: Second update based on PR review

* docs: Updated based on PR review

* Change max_size data type

* Use std::array instead of std::vector
2020-11-14 07:31:11 +05:30
Sagar Pandya
8a24e44a4c
fix: Issue in list_array.cpp resolved (#1342)
* Exit code added to exit from infinite loop

* fix typos and resolve all clang-tidy warnings

* changed C type array style and changed code accordingly in list_array.cpp

* pass const array to resolve clang-tidy error in list_array.cpp

* Update newline in list_array.cpp

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

Co-authored-by: David Leal <halfpacho@gmail.com>
2020-10-22 12:40:22 -05:00
pratamjain
c915f9f3c2
Updated stack_using_array.cpp (#1137)
Added bottom function for getting bottom element from a stack .
2020-10-02 08:22:14 -04:00
Bolaji Boluwatife
6e77f98494
Revised Linked List (#999)
* Addition of Test to LinkedList

I noticed an infinite loop when the program asks the user to "Enter the element to be inserted:", and the user enters a wrong input such as "rr".

* Revised Tests

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* Update data_structures/linked_list.cpp

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

* Update data_structures/linked_list.cpp

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

* Update data_structures/linked_list.cpp

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

* Update data_structures/linked_list.cpp

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

* Update data_structures/linked_list.cpp

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

* Update data_structures/linked_list.cpp

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

* Update data_structures/linked_list.cpp

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

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* Update data_structures/linked_list.cpp

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

* added documentations to functions

I made a few changes although I'm not sure I covered all.

* Update linked_list.cpp

* function documentation

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

* function documentation

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

* function documentation

* Update linked_list.cpp

* removed global variable

I decided to go with the parameter approach.
Is line 79(Iter& ....) and others like it considered healthy code?

* removed global variable

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* fixed clang errors

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* program rewrite

* Update linked_list.cpp

* Update linked_list.cpp

* Removed extra space

* Update linked_list.cpp

* Delete vdoubly_linked_list.ico

* added documentation

* added documentation

* added documentation

* use of shared_ptr

* use of shared_ptr

* modified linked list

* Update linked_list.cpp

* added string header

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* fixed documentation

* fixed link class

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* Update linked_list.cpp

* fixed link class

* fixed runtime error

Co-authored-by: David Leal <halfpacho@gmail.com>
2020-09-03 19:01:50 -05:00
Krishna Vedala
08c4a3f664
feat: Added merge-insertion sort from #246 (#1062)
* Create Merge-insertion sort.cpp

* fixed file path

* working code

* added documentation

* replace c-style array with std::array

* updating DIRECTORY.md

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

Co-authored-by: sinkyoungdeok <tlsrudejr123@nate.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-09-03 08:51:30 -04:00
Krishna Vedala
f4fe0c6f5b
[fix] rename data_structures namespace (#1061)
* rename data_structures namespace

* spelling correction

* fix namespace doc name
2020-08-27 17:13:27 -04:00
Krishna Vedala
b4bbe9dc4e
[code fix] Fixed trie_tree for code quality and docs & clang-tidy error check (#1059)
* attempt to fix trie-tree code

* clang-tidy fixes

* remove performance-unnecessary-value-param as error - this has auto-fix

* make test() static

* added original author to the description

* added namespace

* doc updates

* fix true spelling

* extended to small & big caps alphabets - 52 characters

* clang-format and clang-tidy fixes for edc2247a

* move const parameter to after the parameters

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-08-27 12:30:14 -04:00
shoniavika
426ecd03f1
Added queue implementation using two stacks (#953)
* added queue implementation using 2 stacks

* added empty queue error handling

* added empty queue error handling

* updated format

* deleted macro

* added documentation

* updated documentation, new func for testing

* added copyright

* documented queue class

* made queue a generic one

* handles lvalue error & added consts

* added namespace
2020-07-18 17:01:03 -04:00
Ayaan Khan
ef13806cd6
Merge pull request #941 from enqidu/skip_list
Skip list
2020-07-13 19:02:48 +05:30
Krishna Vedala
eefe46688d
main function must return 2020-07-13 08:07:44 -04:00
Krishna Vedala
dc4a72c418
fix doc comment block 2020-07-13 08:07:10 -04:00
Krishna Vedala
47f5ad9aaf
fix randomlevel float conversion 2020-07-12 17:47:57 -04:00
Krishna Vedala
c15c962f02
since we are using smart pointers, an explicit destructor is not required 2020-07-12 17:04:09 -04:00
Krishna Vedala
f970ce361c
tidied up code based on error reports by clang-tidy 2020-07-12 17:00:27 -04:00
enqidu
ddf148b613 Merge branch 'skip_list' of https://github.com/enqidu/C-Plus-Plus into skip_list 2020-07-12 19:25:14 +04:00
enqidu
a707d710b5 update 2020-07-12 19:24:46 +04:00
enqidu
af49a02ed8
Update data_structures/skip_list.cpp
Co-authored-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
2020-07-10 21:27:51 +04:00
enqidu
5d225aba87
Update data_structures/skip_list.cpp
Co-authored-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
2020-07-10 21:27:35 +04:00
enqidu
b1b3b310a4
Update data_structures/skip_list.cpp
Co-authored-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
2020-07-10 21:27:22 +04:00
enqidu
2fecf67a36 parameters 2020-07-10 21:11:20 +04:00
enqidu
a90dcc5f66 parameters 2020-07-10 21:10:21 +04:00