Commit Graph

230 Commits

Author SHA1 Message Date
Joe Czarnecki
a6502e0af0 Update Scala Solutions 2020-03-03 16:46:16 +01:00
Joe Czarnecki
696a657c6f Create Scala Solutions
I've been working through the book and I was surprised to see there wasn't a Scala Solution here. I created a mutable version as close to the original as possible and immutable recursive version.
2020-03-03 16:16:49 +01:00
fhl43211
e6558351a8 Use lambda function 2020-02-21 09:06:58 -08:00
fhl43211
4fd96f6987 Create cpp file 2020-02-20 17:23:54 -08:00
Ruslan Korolev
891eec2873 fix 04_recursive_max on ruby 2020-01-17 18:29:34 +02:00
Alexander Danilchenko
52a5a7cc24 Changed code style according to new Java versions
Changed long and ugly type declarations with "var" keyword (Java 10).  Also fixed warning about raw usage of HashSet without type specification.
2020-01-12 18:34:55 +02:00
Vladimir Pavlovic
d771cb21a0 Rename 01_longest_common_subsequence to 01_longest_common_subsequence.cpp 2020-01-03 00:46:37 +01:00
TimoSci
ff7ae962c1 edit comments 2019-12-08 13:31:33 +01:00
TimoSci
1f6cf7d460 avoid use of global variables; it is more rubyish to represent a graph as a class 2019-12-08 13:07:44 +01:00
TimoSci
70ddf46cb3 represent record of searched verices as a hash for O(1) lookup 2019-12-08 12:56:36 +01:00
TimoSci
b65c3de283 separate search functionality from seller checking fucntionality according to single responsibility principle 2019-12-08 12:40:40 +01:00
Timo J
c849e75041 More concise Rubyish code.
Hash key checking is not necessary in this case.  If a key doesn't exist in a Hash, Ruby returns nil by default and nil is falsy. Hash key checking would only be necessary if the Hash had been set up with a default value.
2019-12-08 12:03:15 +01:00
BryanChan777
7971852b0e Update README.md 2019-11-23 16:46:38 -08:00
Dmitry Neverovski
b4c440089f Update zero factorial
The Definition of a Zero Factorial
Because zero has no lower numbers but is still in and of itself a number, there is still but one possible combination of how that data set can be arranged: it cannot. This still counts as one way of arranging it, so by definition, a zero factorial is equal to one, just as 1! is equal to one because there is only a single possible arrangement of this data set.
2019-11-20 20:15:19 +03:00
Giorgio
d8da439590 implement recursive binary serach in rust (#93) 2019-11-12 09:19:36 -06:00
Massoud Afrashteh
9dc7611411 Julia samples (#108)
* Add julialang binary search sample

* Add unit test

* Add julialang selection sort sample

* Change julia suffix to jl

* Add recursion and quick sort with tests

* add quick sort

* Add hash table samples

* Add BFS

* Changed file names

* Add dijkstras

* Add Dijkstras test
2019-11-12 09:19:21 -06:00
fdrvrtm
30bbe9cf01 Fix the variable typo and add the function call (#109) 2019-11-12 09:19:09 -06:00
Michael Mkwelele
0377eab73c Add tests for the binary search implementation. (#110) 2019-11-12 09:19:00 -06:00
Michael Mkwelele
184f80127c Add tests for factorial example. (#112) 2019-11-12 09:18:52 -06:00
Felice Forby
4c3bc702f4 Add recursive binary search for ruby (ch. 1) and improve recursive max for ruby (ch. 4) (#113)
* add recursive binary search for ruby

* account for cases with empty lists and lists with only one item

* use p instead of print to show nil value

* add newline at end of file
2019-11-12 09:18:34 -06:00
bigpas
6b9faa9cab fix: naming convention. Min. refactor (#116)
* fix: naming convention. Min. refactor

* add: 05 for Kotlin
2019-11-12 09:18:17 -06:00
Evgeny Samsonov
3a50470e3d Add dijkstras algorithm in golang (#118)
* Golang dijkstra algorithm

* New line in end of file
2019-11-12 09:18:00 -06:00
Yury
9b0288d791 Update 02_recursive_selection_sort.js (#119) 2019-11-12 09:17:35 -06:00
Lu Zhang
878e26217d Update SetCovering.java (#120)
The statesNeeded and finalStations set should be updated after the for loop which finds the bestStation.
2019-10-30 16:32:32 -05:00
Alexander Danilchenko
59ee067417 Update 01_selection_sort.js (#122) 2019-10-30 16:32:21 -05:00
Alexander Danilchenko
4bc8132647 Update 01_breadth-first_search.cpp (#124)
Improved code stylistic integrity.
2019-10-30 16:32:05 -05:00
Evgeniy
ee7dcd3b3d Update 02_recursive_binary_search.js (#125) 2019-10-30 16:31:50 -05:00
Alexander Danilchenko
03db2855d6 According to the book changes (#144)
Changed the name of the variable according to the book
2019-10-30 16:31:21 -05:00
Alexander Danilchenko
fb81c11ca9 C++11 solution to the 8th chapter problem. (#145)
* C++11 solution to 8th chapter problem.

* Update 01_set_covering.cpp

* Extra space correction
2019-10-30 16:30:40 -05:00
Alexander Danilchenko
d889159744 Added C++ Solution for 9th chapter (#146)
* Added C++ Solution for 9th chapter

* Fixed extra space

* Fixed another extra space

* Output style correction
2019-10-30 16:30:31 -05:00
Ivan Novikov
009689b294 Kotlin examples for 08 chapter (#147) 2019-10-30 16:30:20 -05:00
Candido Sales Gomes
591111e596 add dijkstra to golang (#149) 2019-10-30 16:29:20 -05:00
Alexandrshy
a76c5e5d7d Fixed formatting problems, added JSDoc, deleted duplicate example 2019-07-27 02:00:06 +04:00
Alexandrshy
5a1d2c04d4 Fixed formatting problems 2019-07-26 00:29:41 +04:00
Alexandrshy
2216e23b6b Fixed formatting problems, added JSDoc 2019-07-25 08:53:03 +04:00
Alexandrshy
b4b5161ff9 Fixed formatting problems, added JSDoc, added example for JS, fixed example for JS 2019-07-24 22:38:14 +04:00
Alexandrshy
a1dbe470cc Fixed formatting problems, added JSDoc, added example for JS, fixed example for JS 2019-07-24 09:25:02 +04:00
Alexandrshy
84b6d19416 Fixed formatting problems 2019-07-23 08:37:29 +04:00
Alexandrshy
61b2925a2d Fixed formatting problems, example and JSDoc 2019-07-21 09:05:39 +04:00
Yuriy Marad
bac32b613b Add PHP example for chapter 09 - dynamic programming (#98) 2019-03-28 14:53:48 -07:00
Yusuf Qedan
cc845c40f7 make search return true when mango seller is found (#99) 2019-03-28 14:53:30 -07:00
Max Beatty
5b675cc2e8 Complete "longest common ..." examples (#100)
* no else return

* fix var ref

* fix importing/requiring dependencies

* complete longest common examples
2019-03-28 14:52:55 -07:00
Alex
c23ca90b83 update binarySearch function for es6 recursive (#101) 2019-03-28 14:52:08 -07:00
Alex
c745f5d2a7 add code for chapters 1 and 2 in ts (#102) 2019-03-28 14:51:48 -07:00
Alex
d77cde9e67 Add code for chapter 3 and 4 in ts (#103) 2019-03-28 14:51:36 -07:00
Alex
97003f16df Add code for chapter 5 in ts (#104) 2019-03-28 14:51:19 -07:00
Alex
393b8e135d Add code for chapter 6 in ts (#105) 2019-03-28 14:51:05 -07:00
Massoud Afrashteh
62c3b39668 Add julialang binary search sample (#107)
* Add julialang binary search sample

* Add unit test
2019-03-28 14:50:48 -07:00
Oleg A. Glushko
06ee65d9e5 Please, merge my PowerShell examples for all chapters (#106)
* PowerShell 01_introduction_to_algorithms example

* PowerShell 02_selection_sort example

* PowerShell 03_recursion examples

* PowerShell 04_quicksort examples

* PowerShell 05_hash_tables examples

* PowerShell 06_breadth-first_search example

* PowerShell 07_dijkstras_algorithm example

* PowerShell 08_greedy_algorithms example

* Powershell 09_dynamic_programming example
2019-03-28 14:49:20 -07:00
Maria Kovaleva
d7de908a82 Fix countdown.py returning None (#94)
The original code does not return the value in the if-clause and the return statement in the else-clause, which led to the function returning None at the end of the countdown (5, 4, 3, 2, 1, 0, None).
2018-12-28 08:25:48 -08:00