Skip to content

Commit e362536

Browse files
committed
License 0BSD; add documentation
1 parent 3474aa9 commit e362536

File tree

9 files changed

+124
-4
lines changed

9 files changed

+124
-4
lines changed

.gitattributes

Lines changed: 0 additions & 2 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
"antistable",
44
"bottomup",
55
"byhash",
6+
"Eliah",
7+
"Kagan",
68
"kwoa",
79
"mergesort",
810
"nums",
11+
"palgoviz",
912
"quux",
1013
"timeit",
1114
"timsort"

LICENSE

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
BSD Zero Clause License
2+
3+
Copyright (c) 2021, 2023 Eliah Kagan
4+
5+
Permission to use, copy, modify, and/or distribute this software for any
6+
purpose with or without fee is hereby granted.
7+
8+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14+
PERFORMANCE OF THIS SOFTWARE.

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!-- SPDX-License-Identifier: 0BSD -->
2+
3+
# algorithms-python (algorithms-suggestions)
4+
5+
This is one of three partial implementations of the
6+
[**algorithms-suggestions**](https://github.com/EliahKagan/algorithms-suggestions)
7+
exercises. The others are [**Pool**](https://github.com/EliahKagan/Pool) and
8+
[**Search**](https://github.com/EliahKagan/Search).
9+
10+
This was an experiment in doing some of those exercise ideas in Python (even
11+
though they were brainstormed with C++ in mind).
12+
13+
*If you found this by searching, you might be looking for
14+
[**palgoviz**](https://github.com/EliahKagan/palgoviz) instead.*
15+
16+
## License
17+
18+
[0BSD](https://spdx.org/licenses/0BSD.html). See [**`LICENSE`**](LICENSE).
19+
20+
## Getting started
21+
22+
These steps, which assume you have a working `pipenv` command, create or update
23+
the virtual environment and run the tests:
24+
25+
```sh
26+
pipenv install -d
27+
pipenv run pytest --doctest-modules
28+
```
29+
30+
## Suggested usage
31+
32+
You might:
33+
34+
- Look at the implementations in detail to see how they work, ***or***
35+
36+
- Don't look at them (at least not in detail), remove function and class bodies
37+
(except docstrings), and rework them as problems/exercises. (Then, once tests
38+
are passing, run `git diff` to compare your solutions with the originals.)
39+
40+
## Future directions
41+
42+
Development is not continuing on this project much, but it's possible some
43+
parts of it, especially the material in `sll.py`, might make its way into
44+
[palgoviz](https://github.com/EliahKagan/palgoviz).

helpers.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
#!/usr/bin/env python3
22

3+
# Copyright (c) 2021, 2023 Eliah Kagan
4+
#
5+
# Permission to use, copy, modify, and/or distribute this software for any
6+
# purpose with or without fee is hereby granted.
7+
#
8+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9+
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10+
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11+
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12+
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13+
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14+
# PERFORMANCE OF THIS SOFTWARE.
15+
316
"""Some helper functions used in multiple modules."""
417

518
__all__ = [

sll.ipynb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
{
22
"cells": [
3+
{
4+
"attachments": {},
5+
"cell_type": "markdown",
6+
"id": "2d07956f",
7+
"metadata": {},
8+
"source": [
9+
"# Singly linked lists - `sll.py` benchmarks\n",
10+
"\n",
11+
"SPDX-License-Identifier: 0BSD"
12+
]
13+
},
314
{
415
"cell_type": "code",
516
"execution_count": 1,
@@ -128,7 +139,7 @@
128139
"name": "python",
129140
"nbconvert_exporter": "python",
130141
"pygments_lexer": "ipython3",
131-
"version": "3.11.1"
142+
"version": "3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)]"
132143
},
133144
"vscode": {
134145
"interpreter": {

sll.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
#!/usr/bin/env python3
22

3+
# Copyright (c) 2021, 2023 Eliah Kagan
4+
#
5+
# Permission to use, copy, modify, and/or distribute this software for any
6+
# purpose with or without fee is hereby granted.
7+
#
8+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9+
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10+
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11+
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12+
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13+
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14+
# PERFORMANCE OF THIS SOFTWARE.
15+
316
"""
417
Singly Linked Lists
518

warmup.ipynb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
{
22
"cells": [
3+
{
4+
"attachments": {},
5+
"cell_type": "markdown",
6+
"id": "73ccd7b6",
7+
"metadata": {},
8+
"source": [
9+
"# Demo and benchmarks for `warmup.py`\n",
10+
"\n",
11+
"SPDX-License-Identifier: 0BSD"
12+
]
13+
},
314
{
415
"cell_type": "code",
516
"execution_count": 1,
@@ -176,7 +187,7 @@
176187
"name": "python",
177188
"nbconvert_exporter": "python",
178189
"pygments_lexer": "ipython3",
179-
"version": "3.11.1"
190+
"version": "3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)]"
180191
},
181192
"vscode": {
182193
"interpreter": {

warmup.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
#!/usr/bin/env python3
22

3+
# Copyright (c) 2021, 2023 Eliah Kagan
4+
#
5+
# Permission to use, copy, modify, and/or distribute this software for any
6+
# purpose with or without fee is hereby granted.
7+
#
8+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9+
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10+
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11+
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12+
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13+
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14+
# PERFORMANCE OF THIS SOFTWARE.
15+
316
"""
417
Implementations for warmup exercises in
518
https://github.com/EliahKagan/algorithms-suggestions/blob/master/algorithms-suggestions.md

0 commit comments

Comments
 (0)