dsatantra 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dsatantra-0.1.0/PKG-INFO +30 -0
- dsatantra-0.1.0/README.md +12 -0
- dsatantra-0.1.0/dsatantra/__init__.py +3 -0
- dsatantra-0.1.0/dsatantra/algorithms.py +53 -0
- dsatantra-0.1.0/dsatantra.egg-info/PKG-INFO +30 -0
- dsatantra-0.1.0/dsatantra.egg-info/SOURCES.txt +8 -0
- dsatantra-0.1.0/dsatantra.egg-info/dependency_links.txt +1 -0
- dsatantra-0.1.0/dsatantra.egg-info/top_level.txt +1 -0
- dsatantra-0.1.0/setup.cfg +4 -0
- dsatantra-0.1.0/setup.py +24 -0
dsatantra-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dsatantra
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A package containing hardcoded C++ code for DSA algorithms
|
|
5
|
+
Home-page:
|
|
6
|
+
Author: Utkarsh
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.6
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Dynamic: author
|
|
13
|
+
Dynamic: classifier
|
|
14
|
+
Dynamic: description
|
|
15
|
+
Dynamic: description-content-type
|
|
16
|
+
Dynamic: requires-python
|
|
17
|
+
Dynamic: summary
|
|
18
|
+
|
|
19
|
+
# dsatantra
|
|
20
|
+
|
|
21
|
+
A Python package that provides hardcoded C++ code for common Data Structures and Algorithms.
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from dsatantra import get_binary_search_cpp, get_quick_sort_cpp
|
|
27
|
+
|
|
28
|
+
print(get_binary_search_cpp())
|
|
29
|
+
print(get_quick_sort_cpp())
|
|
30
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# dsatantra
|
|
2
|
+
|
|
3
|
+
A Python package that provides hardcoded C++ code for common Data Structures and Algorithms.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
from dsatantra import get_binary_search_cpp, get_quick_sort_cpp
|
|
9
|
+
|
|
10
|
+
print(get_binary_search_cpp())
|
|
11
|
+
print(get_quick_sort_cpp())
|
|
12
|
+
```
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
def get_binary_search_cpp():
|
|
2
|
+
return """
|
|
3
|
+
#include <iostream>
|
|
4
|
+
#include <vector>
|
|
5
|
+
|
|
6
|
+
int binarySearch(const std::vector<int>& arr, int target) {
|
|
7
|
+
int left = 0;
|
|
8
|
+
int right = arr.size() - 1;
|
|
9
|
+
|
|
10
|
+
while (left <= right) {
|
|
11
|
+
int mid = left + (right - left) / 2;
|
|
12
|
+
|
|
13
|
+
if (arr[mid] == target)
|
|
14
|
+
return mid;
|
|
15
|
+
|
|
16
|
+
if (arr[mid] < target)
|
|
17
|
+
left = mid + 1;
|
|
18
|
+
else
|
|
19
|
+
right = mid - 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return -1;
|
|
23
|
+
}
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
def get_quick_sort_cpp():
|
|
27
|
+
return """
|
|
28
|
+
#include <iostream>
|
|
29
|
+
#include <vector>
|
|
30
|
+
|
|
31
|
+
int partition(std::vector<int>& arr, int low, int high) {
|
|
32
|
+
int pivot = arr[high];
|
|
33
|
+
int i = (low - 1);
|
|
34
|
+
|
|
35
|
+
for (int j = low; j <= high - 1; j++) {
|
|
36
|
+
if (arr[j] < pivot) {
|
|
37
|
+
i++;
|
|
38
|
+
std::swap(arr[i], arr[j]);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
std::swap(arr[i + 1], arr[high]);
|
|
42
|
+
return (i + 1);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
void quickSort(std::vector<int>& arr, int low, int high) {
|
|
46
|
+
if (low < high) {
|
|
47
|
+
int pi = partition(arr, low, high);
|
|
48
|
+
|
|
49
|
+
quickSort(arr, low, pi - 1);
|
|
50
|
+
quickSort(arr, pi + 1, high);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
"""
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dsatantra
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A package containing hardcoded C++ code for DSA algorithms
|
|
5
|
+
Home-page:
|
|
6
|
+
Author: Utkarsh
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.6
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Dynamic: author
|
|
13
|
+
Dynamic: classifier
|
|
14
|
+
Dynamic: description
|
|
15
|
+
Dynamic: description-content-type
|
|
16
|
+
Dynamic: requires-python
|
|
17
|
+
Dynamic: summary
|
|
18
|
+
|
|
19
|
+
# dsatantra
|
|
20
|
+
|
|
21
|
+
A Python package that provides hardcoded C++ code for common Data Structures and Algorithms.
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from dsatantra import get_binary_search_cpp, get_quick_sort_cpp
|
|
27
|
+
|
|
28
|
+
print(get_binary_search_cpp())
|
|
29
|
+
print(get_quick_sort_cpp())
|
|
30
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
dsatantra
|
dsatantra-0.1.0/setup.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
long_description = ""
|
|
5
|
+
if os.path.exists("README.md"):
|
|
6
|
+
with open("README.md", "r") as fh:
|
|
7
|
+
long_description = fh.read()
|
|
8
|
+
|
|
9
|
+
setup(
|
|
10
|
+
name='dsatantra',
|
|
11
|
+
version='0.1.0',
|
|
12
|
+
packages=find_packages(),
|
|
13
|
+
description='A package containing hardcoded C++ code for DSA algorithms',
|
|
14
|
+
long_description=long_description,
|
|
15
|
+
long_description_content_type='text/markdown',
|
|
16
|
+
author='Utkarsh',
|
|
17
|
+
url='',
|
|
18
|
+
classifiers=[
|
|
19
|
+
'Programming Language :: Python :: 3',
|
|
20
|
+
'License :: OSI Approved :: MIT License',
|
|
21
|
+
'Operating System :: OS Independent',
|
|
22
|
+
],
|
|
23
|
+
python_requires='>=3.6',
|
|
24
|
+
)
|