Commit Graph

553 Commits (09b5568315246e6553e870f36e32bf53f444b58b)
 

Author SHA1 Message Date
Christian Clauss efc9eb7e94
chore: migrate Python to new directory structure (#207)
* chore: Migrate Python to new directory structure

* git add algorithms/Python/README.md

* Cleanup URLs

* Update README.md
2021-04-15 15:29:20 -04:00
Christian Clauss e4f814b23d
Fix typo (#208)
* Fix typo

* Update README.md
2021-04-15 13:43:24 -04:00
Toihir Halim 0474e3e216
Added string subsequence in JS (#196)
* Added string subsequence in js

* remove extra line
2021-04-15 11:23:25 -04:00
Ming Tsai ee31aca70b
docs: add dotnetfiddle link 2021-04-15 11:12:27 -04:00
goelRagga 9138e8497e
Add binary search tree for C++ (#186) 2021-04-15 09:12:53 -04:00
Ming Tsai b0e089603c
chore: add paths for dotnet action (#205) 2021-04-15 09:10:43 -04:00
Rahul Rajeev Pillai 0ea8537c90
Added functionality to merge two singly linked list (#192) 2021-04-15 08:48:55 -04:00
Ming Tsai 5c662d3c41
chore: add ignore word (#204) 2021-04-15 08:46:11 -04:00
Christian Clauss 333a2facea
Python: Total number of words in a sentence (#194) 2021-04-15 07:16:20 -04:00
Aayush Jain 8d5cae05ff
Merge pull request #185 from UG-SEP/UG
Total number of words in a sentence
2021-04-15 11:49:35 +05:30
Arsenic 1b2260be77
Fix typo in comments
./strings/c-or-cpp/count-words.c:47: returing ==> returning
2021-04-15 11:24:06 +05:30
Ujjwal cf1bc4692f
Merge branch 'main' into UG 2021-04-15 11:04:36 +05:30
Ujjwal 38ef762be2
requested changes done 2021-04-15 11:00:34 +05:30
Ming Tsai 92e336fcae chore: add path on restore, build and test 2021-04-14 21:57:01 -04:00
Ming Tsai ed658ec53d
chore: list the folder before run dotnet test 2021-04-14 21:53:40 -04:00
Ming Tsai e9c25476d6
chore: list the directory 2021-04-14 21:50:45 -04:00
Ming Tsai f62e6f7281
fix: the cd path 2021-04-14 21:45:49 -04:00
Ming Tsai 9d35a9e42c
chore: add dotnet action 2021-04-14 21:44:45 -04:00
Ming Tsai 2f47d5c828
chore: moving csharp file to its project (#198) 2021-04-14 21:42:45 -04:00
Toihir Halim ef836c94d0
Added string tokenizer in java (#184)
* Added string tokenizer in java

* fix typos

* Update Readme change line index from 4 to 5
2021-04-14 20:37:29 -04:00
JACOB JAMES K 2f86af8736
Added Java Implementation of Dijkstras Algorithm for Single Source Shortest Path (#187)
* Added Java Implementation of Dijkstras Algorithm for Single Source Shortest Path

* Added changes to Dijkstras Algorithm Implementation according to review

* Corrected spelling mistakes
2021-04-14 14:54:00 -04:00
Aayush Jain 6cb96b0d44
Added myself to reviewer's list. (#191)
* Clone linked list with random pointer

* addition in  reviewers list
2021-04-14 14:38:49 -04:00
Christian Clauss d991c37cf1
Add Python doctests to singly linked list (#190) 2021-04-14 14:37:20 -04:00
Toihir Halim 0ca911387b
Add trees pre in post traversal java (#178)
* add pre, in and post traversal trees in java

* Update README.md

* update line 49 to pass lint test

change "System.out.print("\n\nin order: "); 
to 
System.out.println("\n");
System.out.print("in order: ");
2021-04-14 11:31:22 -04:00
Ujjwal f662b85975
added count words program link 2021-04-14 20:24:42 +05:30
UG-SEP f017b5df71 added Count Words.c 2021-04-14 20:19:59 +05:30
Sanjay PS ca93cfa934
Added program in c for printing unique elements in an array (#143)
* Added program in c for printing unique elements in an array

* Update unique-elements-in-an-array.c

* Update unique-elements-in-an-array.c

* Update unique-elements-in-an-array.c

* Update unique-elements-in-an-array.c

- Make array declaration dynamic
- Formatted the output
- Cleanup of extra spaces in the program

Co-authored-by: Arsenic <54987647+Arsenic-ATG@users.noreply.github.com>
2021-04-14 09:22:22 -04:00
Aayush Jain b2cf773646
Clone linked list with random pointer (#180) 2021-04-14 08:40:52 -04:00
Toihir Halim 756589e272
Add reverse linked list in java (#182) 2021-04-13 23:43:37 -04:00
Ming Tsai 2017c59218
chore: add ignore word (#181) 2021-04-13 19:09:05 -04:00
Venkata Sridhar Sai 4d5176223f
added stack implementation and the standard problems on stacks in java (#174)
* added stack implementation and some standard problems on stacks in java

* Update stacks/JAVA/The_Stock_Span_Problem.java

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update stacks/JAVA/The_Stock_Span_Problem.java

Co-authored-by: Christian Clauss <cclauss@me.com>

* all the suggestions addressed

* comments wrapped,Thanks for the suggestion.

* Update The_Stock_Span_Problem.java

* folder renamed

* renamed files

* Delete Balanced_Paranthesis.java

* Delete The_Stock_Span_Problem.java

* Delete stack.java

Co-authored-by: Christian Clauss <cclauss@me.com>
2021-04-13 14:53:25 -04:00
Atin Bainada 0a9135b5b3
Added doctest in palindrome.py (#172)
* Added doctest in palindrome.py

* small change to re run lint_python test
2021-04-13 12:01:28 -04:00
Atin Bainada 8793610586
fix: typo in readme (#173) 2021-04-13 11:31:18 -04:00
Ritish Sehgal 7afe26d505
Added build Binary Tree function in Cpp (#160)
* added max subarray sum

* added pre,in,post traversals

* Update pre-in-post-traversal.cpp

formatted the output

* Update pre-in-post-traversal.cpp

formatted output

* added build binary tree function

Co-authored-by: Arsenic <54987647+Arsenic-ATG@users.noreply.github.com>
2021-04-13 11:00:41 -04:00
Ming Tsai 3d81af66e5
docs: add reviewers list 2021-04-13 09:30:56 -04:00
Christian Clauss 7a9ae18fca
Add Python doctest to interval-scheduling.py (#162)
* Add Python doctest to interval-scheduling.py

* URL to a description of the algorithm used

* Remove a stale comment
2021-04-13 07:00:59 -04:00
Christian Clauss bd860a57a4
Add Python doctest to insertion-sort.py (#165)
* Add Python doctest to insertion-sort.py

* if __name__ == "__main__":

* Update insertion-sort.py
2021-04-12 12:23:20 -04:00
Christian Clauss 66c65383fb
Add Python doctests to quicksort.py (#166)
* Add Python doctests to quicksort.py

* quicksort(list(reversed(ascii_letters)))

* Update quick-sort.py
2021-04-12 12:22:12 -04:00
Christian Clauss 488eec39ef
Self-documenting variable names make comment unnecessary (#163) 2021-04-12 12:15:46 -04:00
Christian Clauss 2a8185f159
Add Python doctests to count-inversions.py (#159)
* Add Python doctests to count-inversions.py

These [doctests](https://docs.python.org/3/library/doctest.html) can be run with `python3 -m doctest -v count-inversions.py`

Our GitHub Actions will also run these doctests.  https://github.com/MakeContributions/DSA/actions

The answer to the last test should be 0, not 2.

@atin Your review please.

* Avoid unnecessary inversions
2021-04-12 06:03:47 -04:00
Christian Clauss e151d71572
Use Pythonic item access (#164) 2021-04-12 06:02:56 -04:00
Christian Clauss b95fa5b691
Add Python doctest to selection_sort.py (#167)
* Add Python doctest to selection_sort.py

* fix isort

* Update selection-sort.py

* all(selection_sort(arr) or arr == sorted(arr) for arr in arrays)
2021-04-12 06:02:35 -04:00
Christian Clauss 8dd686a31c
DoublyLinkedList.__iter__() (#168) 2021-04-11 17:49:05 -04:00
Christian Clauss c245d22869
Add Python doctests to karatsuba.py (#161)
* Add Python doctests to karatsuba.py

`subtract()` can give the wrong answer when `y` > `x`.  @atin Your review please.

* add() and absolute_difference()

* absolute_difference("1", "0")

* Update karatsuba.py

* Update karatsuba.py
2021-04-11 17:43:57 -04:00
Toihir Halim c3db2ee9f9
add arrays left rotation in java (#155) 2021-04-11 13:49:36 -04:00
Christian Clauss d7860a161e
GitHub Action to lint C and C++ code (#156)
* GitHub Action to lint C and C++ code

GitHub Action to run cpplint recursively on all pushes and pull requests https://github.com/cpplint/GitHub-Action-for-cpplint

* Update cpplint.yml

* Update cpplint.yml

* Update cpplint.yml

* Fix import order

Found C system header after C++ system header. Should be: doubly.h, c system, c++ system, other.  [build/include_order] [4]

* Fix import order

* Update string-tokeniser.cpp
2021-04-11 13:48:29 -04:00
Christian Clauss 0459f08eeb
GitHub Action to lint Python code (#151)
* GitHub Action to lint Python code

* Fix typo
2021-04-10 21:21:48 -04:00
Ritish Sehgal c08e033754
Added level order traversal in Binary trees (#153)
* added max subarray sum

* added pre,in,post traversals

* Update pre-in-post-traversal.cpp

formatted the output

* Update pre-in-post-traversal.cpp

formatted output

Co-authored-by: Arsenic <54987647+Arsenic-ATG@users.noreply.github.com>
2021-04-10 05:11:47 -04:00
Arsenic f515542235
Typo fix patch (#154)
* Update README.md

fix typo 
./README.md:14: seperated ==> separated

* Update string-tokeniser.cpp

fix typo 
./strings/c-or-cpp/string-tokeniser.cpp:27: delimeter ==> delimiter

* Update palindrome.js

fix typo 
./strings/js/palindrome.js:4: alpha-numeric ==> alphanumeric

* Update quick-sort.java

fix typo
./sorting/java/quick-sort.java:2: choosen ==> chosen

* Update counting-sort.java

fix typo 
./sorting/java/counting-sort.java:4: algortithm ==> algorithm

* Update merge-sort.java

fix typo 
./sorting/java/merge-sort.java:12: Funtion ==> Function

* Update bubble-sort.cpp

fix typo 
./sorting/c-or-cpp/bubble-sort.cpp:21: swaping ==> swapping

* Update and rename Insert_and_delete_beginning.c to Insert-and-delete-beginning.c

fix typo 
./linked-lists/c-or-cpp/Insert_and_delete_beginning.c:18: Intialize ==> Initialize
and rename the file according to contribution guidlines

* Update Insert-and-delete-beginning.c

fix typo 
./linked-lists/c-or-cpp/Insert_and_delete_beginning.c:37: beggining ==> beginning

* Update bellman-ford.cpp

fix typo 
./graphs/c-or-cpp/bellman-ford.cpp:80: weigth ==> weight

* Update README.md

fix typo 
./stacks/README.md:5: Paranthesis ==> Parenthesis

* Rename balanced-paranthesis.cpp to balanced-parenthesis.cpp

fix typo in name of the file

* Update linear-search.cpp

fix typos 
./searching/c-or-cpp/linear-search.cpp:22: inputed ==> inputted
./searching/c-or-cpp/linear-search.cpp:24: inputed ==> inputted
2021-04-10 05:10:32 -04:00
Aayush Jain 183a3a660e
Add Kadane's Algorithm to Java (#149)
* Kadane’s Algorithm

* Update README.md

* Kadane's Algorithm
2021-04-09 15:38:44 -04:00