geeeks


Namegeeeks JSON
Version 0.1.5 PyPI version JSON
download
home_page
SummaryA package to make your life easy.
upload_time2023-09-04 14:30:28
maintainer
docs_urlNone
authoryashpra1010 (Yash Prajapati)
requires_python>=3.6
license
keywords math dyanmic programming greedy graph divide and conquer algorithm encryption decryption
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Geeeks - A simple and helpful package
Install/Upgrade our package
```
pip install geeeks # install
pip install --upgrade geeeks # upgrade
```

## String Functions  
1. Reverse String: reverse(string)
```
from geeeks import StringFunctions as sf

my_string = "AnyRandomString"
rev = sf.reverse(my_string)

print(rev)
# Output: gnirtSmodnaRynA
```

2. Make Link: make_link(string)
```
from geeeks import StringFunctions as sf

my_string = "Any Random String"
link = sf.make_link(my_string)

print(link)
# Output: any-random-string
```

3. Swap Case: swap_case(string)
```
from geeeks import StringFunctions as sf

my_string = "Any Random String"
swap = sf.swap_case(my_string)
print(swap) # Output: aNY rANDOM sTRING
```

4. Make Chunks: make_chunks(string,k)
```
from geeeks import StringFunctions as sf

my_string = "ABCDEFGHI"
k = 3

print(sf.make_chunks(my_string,k))
# Output: ['ABC','DEF','GHI']
```

## Encryption & Decryption Techniques
1. Caesar Cipher: caesarCipher(s=string(), key=int())
```
from geeeks import Encryption as encrypt
from geeeks import Decryption as decrypt

string = "this-is-my-secret-message"
key = 4

cipher = encrypt.caesarCipher(string, key)
print(cipher) # Output: xlmw-mw-qc-wigvix-qiwweki

message = decrypt.caesarCipher(cipher, key)
print(message) # Output: this-is-my-secret-message
```

## Advance Algorithms  
### Divide & Conquer Algorithms  
This package (geeeks.DnC_Algo) contains the following functions:
* binary_search(arr, x, low, high)
* bubble_sort(arr)
* merge_sort(arr, low, high)
* min_max(arr, low, high)
* quick_sort(arr, low, high)

1. Binary Search  
```
from geeeks import DnC_Algo as dnc

arr = [1,2,3,4,5]
x = 4 # Element to search
low = 0 # lowest index
high = len(arr)-1 # maximum index

res = dnc.binary_search(arr, x, low, high)
if res != -1:
    print(f"Element is present at index: {res}")
else:
    print("Element is not present in array!")
```

2. Bubble Sort
```
from geeeks import DnC_Algo as dnc

arr = [12,9,87,6,43,55,34]
print(dnc.bubble_sort(arr))
```

3. Merge Sort
```
from geeeks import DnC_Algo as dnc

arr = [1,2,3,4,5]
low = 0 # lowest index
high = len(arr) # maximum index

print(arr)
dnc.merge_sort(arr, low, high)
print(arr)
```

4. Minimum & Maximum
```
from geeeks import DnC_Algo as dnc

arr = [34, 67, 78, 45]
low = 0
high = len(arr) - 1 # maximum index
minimum, maximum = dnc.min_max(arr, low, high)
print(f"Maximum: {maximum}\nMinimum: {minimum}")
```

5. Quick Sort
```
from geeeks import DnC_Algo as dnc

arr = [10,9,8,7,6]
low = 0
high = len(arr)-1

print("Before quick sort: {}".format(arr))
dnc.quick_sort(arr, low, high)
print("After quick sort: {}".format(arr))
```

### Dynamic Programming Algorithms
This package (geeeks.DP_Algo) contains the following functions:
* zero_one_knapsack(capacity, weight, profit)
* coin_change(coins, amount)
* longest_common_subsequence(str_a, str_b)
* matrix_multiplication(arr)

1. 0-1 Knapsack Problem
```
from geeeks import DP_Algo as dp

weight = [2, 3, 4, 5]
profit = [1, 2, 5, 6]
capacity = 8

dp.zero_one_knapsack(capacity, weight, profit)
```

2. Coin Change Problem
```
from geeeks import DP_Algo as dp

coins = [2,5,10]
amount = 25
dp.coin_change(coins, amount)
```

3. Longest Common Subsequence
```
from geeeks import DP_Algo as dp

A,B = list("algorithm"), list("analysis")
print(dp.longest_common_subsequence(A,B))
```

4. Matrix Multiplication
```
from geeeks import DP_Algo as dp

arr=[1,2,3,4,1]
print(dp.matrix_multiplication(arr))
```

### Graph Algorithms
This package (geeeks.Graph_Algo) contains the following functions:
* dijkstra(graph)
* floyd(graph, num_vertices)

1. Dijkstra's Algorithm
```
from geeeks import Graph_Algo as gp

graph = [[0, 5, 8, 0], [5, 0, 10, 0], [8, 10, 0, 20], [0, 15, 20, 0]]
gp.dijkstra(graph)
```

2. Floyd-Warshall Algorithm
```
from geeeks import Graph_Algo as gp
INF = 999
graph = [    [0, 3, INF, 7],
         [8, 0, 2, INF],
         [5, INF, 0, 1],
         [2, INF, INF, 0]]

gp.floyd(graph)
```

### Greedy Algorithms
This package (geeeks.Greedy_Algo) contains the following functions:
* fractional_knapsack(values, weight, max_capacity)
* build_huffman_tree(arr, freq)
* job_scheduling(arr)
* prims_mst(graph)

1. Fractional Knapsack
```
from geeeks import Greedy_Algo as gd

values = [280, 100, 120, 120]
weight = [40, 10, 20, 24]
max_capacity = 60
gd.fractional_knapsack(values, weight, max_capacity)
```

2. Huffman Encoding Technique
```
from geeeks import Greedy_Algo as gd

arr = ['a','b','c','d','e','f']
freq = [40,30,20,5,3,2]
gd.build_huffman_tree(arr, freq)
```

3. Job Scheduling
```
from geeeks import Greedy_Algo as gd

# follow this structure for the data
arr = [['j1', 5, 200],
       ['j2', 3, 180],
       ['j3', 3, 190],
       ['j4', 2, 300],
       ['j5', 4, 120],
       ['j6', 2, 100]
       ]

gd.job_scheduling(arr)
```

4. Prim's Algorithm
```
from geeeks import Greedy_Algo as gd

graph = [[0,5,8,0],[5,0,10,0],[8,10,0,20],[0,15,20,0]]
print("MST acc. to Prim's is: {}".format(gd.prims_mst(graph)))
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "geeeks",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "math,dyanmic programming,greedy,graph,divide and conquer,algorithm,encryption,decryption",
    "author": "yashpra1010 (Yash Prajapati)",
    "author_email": "yashpra1010@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/d0/03/9ea1e5b9cbc1b2461bffc7f99493ecb8a2401ab01d02869ca3bb29a11c3b/geeeks-0.1.5.tar.gz",
    "platform": null,
    "description": "# Geeeks - A simple and helpful package\nInstall/Upgrade our package\n```\npip install geeeks # install\npip install --upgrade geeeks # upgrade\n```\n\n## String Functions  \n1. Reverse String: reverse(string)\n```\nfrom geeeks import StringFunctions as sf\n\nmy_string = \"AnyRandomString\"\nrev = sf.reverse(my_string)\n\nprint(rev)\n# Output: gnirtSmodnaRynA\n```\n\n2. Make Link: make_link(string)\n```\nfrom geeeks import StringFunctions as sf\n\nmy_string = \"Any Random String\"\nlink = sf.make_link(my_string)\n\nprint(link)\n# Output: any-random-string\n```\n\n3. Swap Case: swap_case(string)\n```\nfrom geeeks import StringFunctions as sf\n\nmy_string = \"Any Random String\"\nswap = sf.swap_case(my_string)\nprint(swap) # Output: aNY rANDOM sTRING\n```\n\n4. Make Chunks: make_chunks(string,k)\n```\nfrom geeeks import StringFunctions as sf\n\nmy_string = \"ABCDEFGHI\"\nk = 3\n\nprint(sf.make_chunks(my_string,k))\n# Output: ['ABC','DEF','GHI']\n```\n\n## Encryption & Decryption Techniques\n1. Caesar Cipher: caesarCipher(s=string(), key=int())\n```\nfrom geeeks import Encryption as encrypt\nfrom geeeks import Decryption as decrypt\n\nstring = \"this-is-my-secret-message\"\nkey = 4\n\ncipher = encrypt.caesarCipher(string, key)\nprint(cipher) # Output: xlmw-mw-qc-wigvix-qiwweki\n\nmessage = decrypt.caesarCipher(cipher, key)\nprint(message) # Output: this-is-my-secret-message\n```\n\n## Advance Algorithms  \n### Divide & Conquer Algorithms  \nThis package (geeeks.DnC_Algo) contains the following functions:\n* binary_search(arr, x, low, high)\n* bubble_sort(arr)\n* merge_sort(arr, low, high)\n* min_max(arr, low, high)\n* quick_sort(arr, low, high)\n\n1. Binary Search  \n```\nfrom geeeks import DnC_Algo as dnc\n\narr = [1,2,3,4,5]\nx = 4 # Element to search\nlow = 0 # lowest index\nhigh = len(arr)-1 # maximum index\n\nres = dnc.binary_search(arr, x, low, high)\nif res != -1:\n    print(f\"Element is present at index: {res}\")\nelse:\n    print(\"Element is not present in array!\")\n```\n\n2. Bubble Sort\n```\nfrom geeeks import DnC_Algo as dnc\n\narr = [12,9,87,6,43,55,34]\nprint(dnc.bubble_sort(arr))\n```\n\n3. Merge Sort\n```\nfrom geeeks import DnC_Algo as dnc\n\narr = [1,2,3,4,5]\nlow = 0 # lowest index\nhigh = len(arr) # maximum index\n\nprint(arr)\ndnc.merge_sort(arr, low, high)\nprint(arr)\n```\n\n4. Minimum & Maximum\n```\nfrom geeeks import DnC_Algo as dnc\n\narr = [34, 67, 78, 45]\nlow = 0\nhigh = len(arr) - 1 # maximum index\nminimum, maximum = dnc.min_max(arr, low, high)\nprint(f\"Maximum: {maximum}\\nMinimum: {minimum}\")\n```\n\n5. Quick Sort\n```\nfrom geeeks import DnC_Algo as dnc\n\narr = [10,9,8,7,6]\nlow = 0\nhigh = len(arr)-1\n\nprint(\"Before quick sort: {}\".format(arr))\ndnc.quick_sort(arr, low, high)\nprint(\"After quick sort: {}\".format(arr))\n```\n\n### Dynamic Programming Algorithms\nThis package (geeeks.DP_Algo) contains the following functions:\n* zero_one_knapsack(capacity, weight, profit)\n* coin_change(coins, amount)\n* longest_common_subsequence(str_a, str_b)\n* matrix_multiplication(arr)\n\n1. 0-1 Knapsack Problem\n```\nfrom geeeks import DP_Algo as dp\n\nweight = [2, 3, 4, 5]\nprofit = [1, 2, 5, 6]\ncapacity = 8\n\ndp.zero_one_knapsack(capacity, weight, profit)\n```\n\n2. Coin Change Problem\n```\nfrom geeeks import DP_Algo as dp\n\ncoins = [2,5,10]\namount = 25\ndp.coin_change(coins, amount)\n```\n\n3. Longest Common Subsequence\n```\nfrom geeeks import DP_Algo as dp\n\nA,B = list(\"algorithm\"), list(\"analysis\")\nprint(dp.longest_common_subsequence(A,B))\n```\n\n4. Matrix Multiplication\n```\nfrom geeeks import DP_Algo as dp\n\narr=[1,2,3,4,1]\nprint(dp.matrix_multiplication(arr))\n```\n\n### Graph Algorithms\nThis package (geeeks.Graph_Algo) contains the following functions:\n* dijkstra(graph)\n* floyd(graph, num_vertices)\n\n1. Dijkstra's Algorithm\n```\nfrom geeeks import Graph_Algo as gp\n\ngraph = [[0, 5, 8, 0], [5, 0, 10, 0], [8, 10, 0, 20], [0, 15, 20, 0]]\ngp.dijkstra(graph)\n```\n\n2. Floyd-Warshall Algorithm\n```\nfrom geeeks import Graph_Algo as gp\nINF = 999\ngraph = [    [0, 3, INF, 7],\n         [8, 0, 2, INF],\n         [5, INF, 0, 1],\n         [2, INF, INF, 0]]\n\ngp.floyd(graph)\n```\n\n### Greedy Algorithms\nThis package (geeeks.Greedy_Algo) contains the following functions:\n* fractional_knapsack(values, weight, max_capacity)\n* build_huffman_tree(arr, freq)\n* job_scheduling(arr)\n* prims_mst(graph)\n\n1. Fractional Knapsack\n```\nfrom geeeks import Greedy_Algo as gd\n\nvalues = [280, 100, 120, 120]\nweight = [40, 10, 20, 24]\nmax_capacity = 60\ngd.fractional_knapsack(values, weight, max_capacity)\n```\n\n2. Huffman Encoding Technique\n```\nfrom geeeks import Greedy_Algo as gd\n\narr = ['a','b','c','d','e','f']\nfreq = [40,30,20,5,3,2]\ngd.build_huffman_tree(arr, freq)\n```\n\n3. Job Scheduling\n```\nfrom geeeks import Greedy_Algo as gd\n\n# follow this structure for the data\narr = [['j1', 5, 200],\n       ['j2', 3, 180],\n       ['j3', 3, 190],\n       ['j4', 2, 300],\n       ['j5', 4, 120],\n       ['j6', 2, 100]\n       ]\n\ngd.job_scheduling(arr)\n```\n\n4. Prim's Algorithm\n```\nfrom geeeks import Greedy_Algo as gd\n\ngraph = [[0,5,8,0],[5,0,10,0],[8,10,0,20],[0,15,20,0]]\nprint(\"MST acc. to Prim's is: {}\".format(gd.prims_mst(graph)))\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A package to make your life easy.",
    "version": "0.1.5",
    "project_urls": null,
    "split_keywords": [
        "math",
        "dyanmic programming",
        "greedy",
        "graph",
        "divide and conquer",
        "algorithm",
        "encryption",
        "decryption"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1735ca1a665dac41b27f7e9a7d6cd1fa5bc1bdf3db6483631eaf11f65ebbc982",
                "md5": "4b3161eed2d11d8053736bda77bd948b",
                "sha256": "19abc595559ed345689f0996be777684a51b8e25a2d5e9af3575ad6c7efcf841"
            },
            "downloads": -1,
            "filename": "geeeks-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4b3161eed2d11d8053736bda77bd948b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 8365,
            "upload_time": "2023-09-04T14:30:27",
            "upload_time_iso_8601": "2023-09-04T14:30:27.102125Z",
            "url": "https://files.pythonhosted.org/packages/17/35/ca1a665dac41b27f7e9a7d6cd1fa5bc1bdf3db6483631eaf11f65ebbc982/geeeks-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d0039ea1e5b9cbc1b2461bffc7f99493ecb8a2401ab01d02869ca3bb29a11c3b",
                "md5": "587d02fc149b6c5e44ba959ed745d441",
                "sha256": "0795b0c5c9827a10496bc4ca44b09856190b734ebc7629d909ca46e579941d2d"
            },
            "downloads": -1,
            "filename": "geeeks-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "587d02fc149b6c5e44ba959ed745d441",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 7823,
            "upload_time": "2023-09-04T14:30:28",
            "upload_time_iso_8601": "2023-09-04T14:30:28.242881Z",
            "url": "https://files.pythonhosted.org/packages/d0/03/9ea1e5b9cbc1b2461bffc7f99493ecb8a2401ab01d02869ca3bb29a11c3b/geeeks-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-04 14:30:28",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "geeeks"
}
        
Elapsed time: 0.12034s