306 Commits

Author SHA1 Message Date
Jinguang
f03841e79a Description:[fix] fixed the C++ compile error for std::find (#241)
Bug: NA
Test: 1.  add "#include <algorithm>" on fisrt line of the file
      2.  It could be normally compiler, or it will report compile error
2022-11-18 16:35:04 -06:00
Aditya Bhargava
07a6d6b506 fix broken case in binary search (python) and remove unneeded base cases 2022-11-18 16:33:23 -06:00
kuznevia
1b76ebb2f1 Update 01_loop_sum_reduce_version.js (#235)
changing variables names to correct
2022-11-18 15:48:56 -06:00
David Choi
75e8e8cd9e Update 01_loop_sum_reduce_version.js (#232)
the first parameter of the reduce function is `previousValue` and the second parameter is `currentValue` so these parameter names need to be fixed.
2022-11-18 15:48:41 -06:00
Udit Gupta
308148653a Enhances 'base case' logic (#227)
Original function does not work when input array is empty or contains a single value. In the revised code, base case has been augmented to support those. Works successfully for all these test cases: find_max([1, 12, 8, 5]), find_max([]), find_max([1])
2022-11-18 15:47:57 -06:00
Aditya Bhargava
3f02143f7f Expand contributions section in README 2022-11-18 15:35:44 -06:00
N3-M3-S1S
b3a143a3ae add dart examples for chapter 1 and 2 (#209)
* add dart example for chapter 1

* add dart example for chapter 2
2022-11-18 15:31:23 -06:00
spring monkey
cd38dc146d Fix formula (#206)
The current version of the formula incorrectly handles the factorial(0) and causes an infinite loop
2022-11-18 15:29:39 -06:00
Vasilii Boldurean
38f962f2a3 Fix: dijkstras example for JavaScript ES6. (#205) 2022-11-18 15:28:46 -06:00
Mikhail Bokov
c91f1ad37f Update 05_quicksort.php (#204) 2022-11-18 15:28:15 -06:00
Matvey
70d4d231bf Fix/Python 06 bfs: case when entrypoint is target (#203)
* Simplify cognitive complexity

* Fix case when entrypoint is target

* Simplyfy check for case: entrypoint is target
2022-11-18 15:27:29 -06:00
Sergey Ivanov
3868623fcd Update SelectionSort2.java (#184)
* Update SelectionSort2.java

Small method

* Update SelectionSort2.java
2022-11-18 14:58:46 -06:00
Rosana Rezende
cf78943cef Update 02_recursive_sum.js (#168)
First, congratulations for the work, the book is very instructive.

In this case, as described in the book, if the list is empty it returns zero, otherwise we apply recursion.

Co-authored-by: Aditya Bhargava <bluemangroupie@gmail.com>
2022-11-18 14:58:08 -06:00
Aditya Bhargava
788c54e92b python lcs example needs to default to 0 if values dont match 2022-11-18 14:55:06 -06:00
Aditya Bhargava
35bb758f5e Delete 07_dijkstras_algorithm/golang directory
deleting to stop case insensitive issue on Mac
2022-11-18 14:53:39 -06:00
Pikachu
06a890c302 A pull request from cx (#164)
* The original code did not consider the exit condition when the stations cannot perfectly cover the states_needed.

* The code in 09_dynamic_programming/python/01_longest_common_subsequence.py is completed. And the 02_longest_common_substring.py is added.
2022-11-18 14:49:50 -06:00
Alexandr Shulaev
c029201ab1 Fixed formatting problems, example and JSDoc (#129) 2022-11-18 14:47:16 -06:00
Alexandr Shulaev
5f416d1129 Issues-126 - Fixed formatting, jsdoc and example for JavaScript/ES6 (#127)
* Issues-126 - Fixed formatting, jsdoc and non-working example for JavaScript/ES6

* Issues-126 - Fixed jsdoc
2022-11-18 14:46:18 -06:00
NikitaLipatov
64a09d6584 05 & 06 exercises (#114)
Co-authored-by: Aditya Bhargava <bluemangroupie@gmail.com>
2022-11-18 14:34:48 -06:00
Aditya Bhargava
0292985401 cleaner max function, remove unnecessary duplication 2022-11-18 14:18:55 -06:00
antonlipilin
2080afc740 Add more ES6 examples 2021-10-06 18:20:52 +04:00
TheDonrad
7d27d15c0d Create Module.bsl (#182) 2021-03-14 10:47:15 -05:00
AndriiNyzhnyk
85281425eb Add more examples for countdown (#183) 2021-03-14 10:46:00 -05:00
ZhanSwift
efa1c0d975 Update 01_selection_sort.swift (#187)
A new for loop statement
2021-03-14 10:44:12 -05:00
Eric Weiss
04823be518 return position (#188) 2021-03-14 10:43:52 -05:00
Tassadar2499
36accc72c6 F# and C# addings (#189)
* F# - Binary Search

* C# - Double selection sort

* quick sort - f#
2021-03-14 10:43:28 -05:00
Kostarev Kirill
fec65db129 Few changes in Swift Code (#191)
* Replaced the confusing construction

* The algorithm works faster than the previous version
2021-03-14 10:42:14 -05:00
Dani El-Ayyass
c1c68d9d2a improve 01_breadth-first_search.py (#195) 2021-03-14 10:39:59 -05:00
Aditya Bhargava
893fd220a1 Merge pull request #196 from julish13/js-factorial-formula-adjustement
factorial formula adjustement
2021-03-14 10:39:17 -05:00
Aditya Bhargava
342a50ab6f Merge pull request #197 from ekram0/Ekram
add great common divisor function
2021-03-14 10:38:31 -05:00
Ekram Mohamed
9f330a765a add great common divisor function 2021-02-18 02:02:57 +02:00
Yulia Kolupaeva
0c4fdddb12 factorial formula adjustement
The formula in book is incorrect because it doesn't include the factorial(0) case and leads to infinite recursion in this case.
2021-02-16 18:10:32 +03:00
Aditya Bhargava
f1acf84f3a Merge pull request #176 from AndriiNyzhnyk/clear_rust_example
Rust. Clear not needed boilerplate.
2020-09-14 12:53:54 -05:00
Aditya Bhargava
de9146234d Merge pull request #174 from FoxyChmoxy/master
Python: Unit tests for Binary Search
2020-09-14 12:53:11 -05:00
Aditya Bhargava
75bf3017d0 Merge pull request #172 from seanyu4296/add-purescript-solution-for-chapter-1-chapter-2
Add purescript solution for chapter 1 chapter 2
2020-09-14 12:52:10 -05:00
Aditya Bhargava
a777aa6068 Merge pull request #167 from moogacs/master
add recursive soln. for python/03_recursion
2020-09-14 10:56:40 -05:00
Aditya Bhargava
1459b8928f Merge pull request #163 from lamalex/recursion-in-rust
Add rust examples to 03_recursion
2020-09-14 10:55:42 -05:00
Aditya Bhargava
7506a133f4 Merge pull request #162 from lamalex/selection-sort-in-rust
Add Rust examples to 02_selection_sort
2020-09-14 10:55:27 -05:00
Aditya Bhargava
0c8dc34e93 Merge pull request #161 from ZGennadiy/fix_es6_selection_sort
Update selection sort ES6 for keep original array immutable
2020-09-14 10:55:10 -05:00
Aditya Bhargava
cb4b1e74b9 Merge pull request #160 from joeczar/patch-1
Create Scala Solutions
2020-09-14 10:54:55 -05:00
Aditya Bhargava
e4a909e94d Merge pull request #159 from fhl43211/master
Please consider adding 01_dijkstras_algorithm in C++ 11
2020-09-14 10:54:09 -05:00
Aditya Bhargava
9dae3a4d1c Merge pull request #157 from rusikf/rk/fix_recursive_ruby_max
Fix 04_recursive_max on ruby
2020-09-14 10:53:53 -05:00
Aditya Bhargava
d001cbd41e Merge pull request #156 from OlexanderD/patch-5
Changed code style according to new Java versions
2020-09-14 10:53:35 -05:00
Aditya Bhargava
34a907f236 Merge pull request #155 from vlada1001/master
Added ".cpp" extension
2020-09-14 10:53:12 -05:00
Aditya Bhargava
437d215a45 Merge pull request #153 from TimoSci/bfs
Bfs
2020-09-14 10:52:27 -05:00
Aditya Bhargava
d83a2b173c Merge pull request #152 from TimoSci/patch-1
More concise Rubyish code.
2020-09-14 10:52:00 -05:00
Aditya Bhargava
e6b0d98443 not quite responsive enough anymore 2020-09-14 10:51:36 -05:00
Aditya Bhargava
90c719afb6 Merge pull request #151 from BryanChan777/patch-2
Update README.md
2020-09-14 10:50:22 -05:00
Aditya Bhargava
0a64ea2802 Merge pull request #150 from neverovski/patch-1
Update zero factorial Golang
2020-09-14 10:49:40 -05:00
Aditya Bhargava
a5d9073242 Merge pull request #143 from Alexandrshy/issues-142-formatting-problems-and-example-for-dynamic-programming
Fixed formatting problems, added JSDoc, deleted duplicate example
2020-09-14 10:48:50 -05:00