TheAlgorithms-Python/data_structures/stacks
Vaibhav Singh 96df906e7a
All suggeted changes within additional time limit tests (#1815)
* With all suggested changes  

possibly covered all the recommended guidelines

* Updated with both slow and faster algorithms

possibally covered all the recomendations

* removed the time comparision part!

* Update data_structures/stacks/next_greater_element.py

Co-Authored-By: Christian Clauss <cclauss@me.com>

* Update data_structures/stacks/next_greater_element.py

Co-Authored-By: Christian Clauss <cclauss@me.com>

* Update data_structures/stacks/next_greater_element.py

Co-Authored-By: Christian Clauss <cclauss@me.com>

* Update data_structures/stacks/next_greater_element.py

Co-Authored-By: Christian Clauss <cclauss@me.com>

* Add benchmark using timeit

https://docs.python.org/3/library/timeit.html

The performance delta between these two implementation is quite small...
```
next_greatest_element_slow(): 1.843442126
     next_greatest_element(): 1.828941414
```

* Optimize slow() to create fast() - Three algorithms in the race

Three algorithms in the race

* Use a bigger test array with floats, negatives, zero

* Setup import next_greatest_element_fast

Co-authored-by: Christian Clauss <cclauss@me.com>
2020-03-27 08:16:07 +01:00
..
__init__.py psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
balanced_parentheses.py psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
infix_to_postfix_conversion.py psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
infix_to_prefix_conversion.py Fix indentation contains tabs (flake8 E101,W191) (#1573) 2019-11-15 23:05:00 -08:00
linked_stack.py Implement Linked Queue and Linked Stack data structures (#1324) 2019-10-18 08:38:31 +02:00
next_greater_element.py All suggeted changes within additional time limit tests (#1815) 2020-03-27 08:16:07 +01:00
postfix_evaluation.py Create codespell.yml (#1698) 2020-01-18 13:24:33 +01:00
prefix_evaluation.py Add a program to evaluate a string in prefix notation (Polish Notation) (#1675) 2020-01-12 15:00:40 +05:30
stack_using_dll.py actions/checkout@v2 (#1643) 2019-12-26 19:50:12 +08:00
stack.py pyupgrade --py37-plus **/*.py (#1654) 2020-01-03 22:25:36 +08:00
stock_span_problem.py Create codespell.yml (#1698) 2020-01-18 13:24:33 +01:00