Commit Graph

144 Commits

Author SHA1 Message Date
Bruno Simas Hadlich
267b5eff40 Added doctest and more explanation about Dijkstra execution. (#1014)
* Added doctest and more explanation about Dijkstra execution.

* tests were not passing with python2 due to missing __init__.py file at number_theory folder

* Removed the dot at the beginning of the imported modules names because 'python3 -m doctest -v data_structures/hashing/*.py' and 'python3 -m doctest -v data_structures/stacks/*.py' were failing not finding hash_table.py and stack.py modules.

* Moved global code to main scope and added doctest for project euler problems 1 to 14.

* Added test case for negative input.

* Changed N variable to do not use end of line scape because in case there is a space after it the script will break making it much more error prone.

* Added problems description and doctests to the ones that were missing. Limited line length to 79 and executed python black over all scripts.

* Changed the way files are loaded to support pytest call.

* Added __init__.py to problems to make them modules and allow pytest execution.

* Added project_euler folder to test units execution

* Changed 'os.path.split(os.path.realpath(__file__))' to 'os.path.dirname()'
2019-07-17 01:09:53 +02:00
Alfonso Rodríguez Pereira
5f991f7740 #315 Renamed all files to snake_case (#993) 2019-07-11 11:16:42 +02:00
Anup Kumar Panwar
4e413c0183 Updated README 2019-07-06 11:11:20 +05:30
Jarred Allen
506bb5ccfe Add Red-Black Binary Search Trees (#954)
* Wrote most of an rbt, missing just removal

* Added some convenience methods.

* Added a color method

* Wrote code to delete, but has issues :(

* Fixed a bug in Red-Black trees

* Fixed bug in tree color validation and delete repairing

* Clean up == comparison to None
2019-07-05 14:13:16 +05:30
Hector S
05e5172093 .vs/ directory, matrix_multiplication_addition file and binary tree directory (#894)
* Added print function into matrix_multiplication_addition.py and removed blank space in data_structures/binary tree directory

* Removed .vs/ folder per #893

* Rename matrix_multiplication_addition.py to matrix_operation.py
2019-06-11 19:24:53 +08:00
luanjerry
f386fce820 Update queue_on_list.py (#851)
* Fixed error in queue_on_list.py
2019-05-31 16:05:24 +08:00
Anup Kumar Panwar
71be23999c refactor 2019-05-26 21:56:10 +05:30
Artyom Belousov
94380a17a8 Added treap (#797)
* Added treap

* Added comments to treap
2019-05-26 06:20:37 +08:00
John Law
48bba495ae
Rename is_Palindrome to is_Palindrome.py (#752) 2019-04-20 15:13:02 +08:00
Reshad Hasan
52d2fbf3cf Add lowest common ancestor to data structures (#732)
* add longest common ancestor in data structures

* add lowest common ancestor to data structures
2019-04-10 23:59:49 +08:00
rohan11074
137871bfef feature to add input (#749) 2019-04-07 23:55:32 +08:00
Ishani
15bc87fb41 Create is_Palindrome (#740) 2019-04-04 16:40:11 +05:30
Maxim Semenyuk
8e67ac3b76 Fix '__bool__' method (#735)
The method returns the truth when the stack is empty
2019-03-10 07:40:29 +05:30
Akash Ali
6f6510623c Update heap.py (#726)
Added comments for the better understanding of heap.
2019-03-04 16:49:36 +08:00
Ashwek Swamy
88b6caa30a fixed balanced_parentheses, Added infix-prefix & postfix evaluation (#621)
* Create infix_to_prefix_conversion.py

* Create postfix_evaluation.py

* Update balanced_parentheses.py
2019-03-02 00:53:29 +08:00
Reshad Hasan
9a44eb4479 Organize graph algorithms (#719)
* organized graph algorithms

* all graph algorithms in Graphs/ folder

* all graph algorithms are in one folder

* Rename number theory/factorial_python.py to maths/factorial_python.py
2019-02-25 17:35:24 +08:00
Mickaël Schoentgen
3dc50529ca Fix DeprecationWarning: invalid escape sequence (#679)
Signed-off-by: Mickaël Schoentgen <contact@tiger-222.fr>
2019-01-08 16:58:47 +08:00
Jithendra Yenugula
d26311424d Adding a program for swap nodes in linkedlist (#667)
* Adding a program for swap nodes in linkedlist

* Updating swapNodes
2018-12-25 21:09:36 +08:00
Mikael Souza
2e2fadf4db Fixed bug where an empty stack would cause error 2018-12-17 10:45:54 -04:00
Mikael Souza
a8cfc14737 Added more parentheses examples 2018-12-17 10:45:16 -04:00
Mikael Souza
2d082cf19c Changed import from .Stack to stack 2018-12-17 10:44:38 -04:00
Harshil
72c217c37e
Update AVLtree.py
Removed blank lines (256 to 287)!
2018-11-23 18:23:06 +01:00
Awfifcuihc
9bbc4d9021 Update AVLtree.py
add comments
2018-11-22 14:33:50 +08:00
Awfifcuihc
d1dba51326
remove commented lines 2018-11-21 12:46:32 +08:00
Awfifcuihc
9f96c155be Update AVLtree.py
add delete function
add demo with shuffled list
add print lines to trace the addition or deletion
2018-11-21 03:25:07 +08:00
Awfifcuihc
6001215b60 Update AVLtree.py
An auto balanced binary tree
with no delete node function
leave for latter
2018-11-20 03:41:52 +08:00
Awfifcuihc
16cc96a092 Create AVLtree.py 2018-11-20 03:34:44 +08:00
Yasser A
840aa6209b fix division by float issue in range heap.py 2018-11-06 17:19:51 -05:00
Rafael García Cuéllar
beafe3656f Re-design psnr.py code and change image names (#592)
* Change some Image File names & re-code the psnr algorithm (conserving both methods). Also Added new example.

* Selected psnr method and reformat some code from arithmetic_analysis
2018-11-05 18:19:08 +01:00
Harshil
5db9d2e54a Merge branch 'master' of git://github.com/gerroo/Python into gerroo-master 2018-11-04 16:04:29 +01:00
gerroo
a834326e0e Added b16, b32, a85, abs, absMax, absMin 2018-11-03 12:08:13 -08:00
Harshil
608a462965 Merge branch 'fix-singly_linked_list' of git://github.com/ashwek/Python-1 into ashwek-fix-singly_linked_list 2018-11-01 18:29:58 +01:00
Ashwek Swamy
f89d3a9ec3
Update singly_linked_list.py 2018-11-01 21:25:45 +05:30
Ashwek Swamy
48aa4c4a01
Update singly_linked_list.py 2018-11-01 21:04:05 +05:30
Aditya Sharma
1b19028117 Update doubly_linked_list.py (#545) 2018-10-31 08:34:55 +01:00
Hrushikesh Hanbar
f1ec84af84 Update balanced_parentheses.py (#538) 2018-10-30 15:29:12 +01:00
Harshil
a84f7c073f Rename segment_tree to segment_tree.py 2018-10-27 13:38:23 +02:00
Harshil
e1d1f8513d
Delete binary_seach_tree.py
I forgot that we already have an implementation of Binary Search! So deleting this one!
2018-10-27 13:36:30 +02:00
Harshil
c787c13a71 Resolve conflicts 2018-10-27 13:29:53 +02:00
Alex Brown
ea2ddaaf6a all valid python 3 2018-10-20 14:45:08 -05:00
Alex Brown
91fccecb56 snake_case all the things 2018-10-19 17:14:25 -05:00
Alex Brown
564179a0ec increment 1 2018-10-19 07:48:28 -05:00
Alex Brown
718b99ae39 increment 1 2018-10-19 07:48:01 -05:00
Parth Shandilya
5d1f72604d
Improved Code and removed Warnings (#483) 2018-10-19 14:00:31 +05:30
Parth Shandilya
07451a6ca4
Improved Code and removed warnings (#482)
Improved Code and removed warnings
2018-10-19 13:28:21 +05:30
ParthS007
0856a61859 Remove Multiple Unused Imports and Variable 2018-10-18 02:58:57 +05:30
Harshil
63c7e8ede1
Minor update
Changed two characters which were the root cause of 'SyntaxError: Non-ASCII character '\xe2' in file main.py, but no encoding declared'
2018-10-04 11:34:50 +02:00
S-Sanyal
054b4b31f4 Made compatible for all versions of python 2018-10-03 21:52:30 +05:30
S-Sanyal
c74b2732d9 Updated 2018-10-03 21:37:46 +05:30
S-Sanyal
dc584f1658 Made the code Python 3 compatible 2018-10-03 20:13:34 +05:30