Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
504c274
Create reverse_recursion_test.py
Aliza-adnan1 Feb 23, 2023
239df0c
Create update.yml
Aliza-adnan1 Feb 23, 2023
993bd1a
Update update.yml
Aliza-adnan1 Feb 23, 2023
67dfcc6
Add files via upload
Sillah-Babar Feb 23, 2023
e3117a1
Update update.yml
Aliza-adnan1 Feb 23, 2023
78cdb73
Merge pull request #1 from Aliza-adnan1/Aliza
Aliza-adnan1 Feb 23, 2023
5c8082e
Create update1.yml
Aliza-adnan1 Feb 23, 2023
45a9da3
Update update1.yml
Aliza-adnan1 Feb 23, 2023
1473400
Update update1.yml
Aliza-adnan1 Feb 23, 2023
2fa0d0b
Update update1.yml
Aliza-adnan1 Feb 23, 2023
5b61f0c
Rename python/string algorithms/reverse_recursion_test.py to reverse_…
Aliza-adnan1 Feb 23, 2023
53f3c80
Update reverse_recursion_test.py
Aliza-adnan1 Feb 23, 2023
f0b829a
Rename python/string algorithms/Reversing a string using Recursion.py…
Aliza-adnan1 Feb 23, 2023
60f1e19
Update reverse_recursion_test.py
Aliza-adnan1 Feb 23, 2023
1fbd8ef
Update update1.yml
Aliza-adnan1 Feb 23, 2023
e38ff1b
Rename Reversing a string using Recursion.py to Reversing_a_string_us…
Aliza-adnan1 Feb 23, 2023
3d55ab4
Update reverse_recursion_test.py
Aliza-adnan1 Feb 23, 2023
6bd6a11
Update Reversing_a_string_using_Recursion.py
Aliza-adnan1 Feb 23, 2023
a77659d
Update reverse_recursion_test.py
Aliza-adnan1 Feb 23, 2023
32ab9d1
Update reverse_recursion_test.py
Aliza-adnan1 Feb 23, 2023
82b9e97
Update reverse_recursion_test.py
Aliza-adnan1 Feb 23, 2023
fcb5a37
Update Reversing_a_string_using_Recursion.py
Aliza-adnan1 Feb 24, 2023
1a45956
Update reverse_recursion_test.py
Aliza-adnan1 Feb 24, 2023
95a7992
Update and rename python/Stack/Stack.py to Stack.py
Aliza-adnan1 Feb 24, 2023
c4ea12e
Create stack_test.py
Aliza-adnan1 Feb 24, 2023
5c1601f
Update stack_test.py
Aliza-adnan1 Feb 24, 2023
1769134
Update update1.yml
Aliza-adnan1 Feb 24, 2023
abfeb3e
Rename Reversing_a_string_using_Recursion.py to python/string algorit…
Aliza-adnan1 Feb 24, 2023
35263ed
Delete reverse_recursion_test.py
Aliza-adnan1 Feb 24, 2023
4ba9b22
Delete .github/workflows directory
Aliza-adnan1 Feb 24, 2023
ad61331
Delete stack_test.py
Aliza-adnan1 Feb 24, 2023
6d25f3e
Rename python/Stack/Stack.py to Stack.py
Aliza-adnan1 Feb 24, 2023
d81518c
Create stack_test.py
Aliza-adnan1 Feb 24, 2023
1e24bb6
Create update1.yml
Aliza-adnan1 Feb 24, 2023
916e74b
Merge branch 'master' into Aliza
Aliza-adnan1 Feb 24, 2023
d41228f
Merge pull request #2 from Aliza-adnan1/Aliza
Aliza-adnan1 Feb 24, 2023
a3d1341
Sorting tests
Sillah-Babar Feb 24, 2023
ecc77d7
Create sillah-workflow.yml
Sillah-Babar Feb 24, 2023
e1cf4c4
Update sillah-workflow.yml
Sillah-Babar Feb 24, 2023
fc99637
Update sillah-workflow.yml
Sillah-Babar Feb 24, 2023
79b9901
Delete update1.yml
Sillah-Babar Feb 24, 2023
a229652
Update sillah-workflow.yml
Sillah-Babar Feb 24, 2023
7392e04
Update update1.yml
Sillah-Babar Feb 24, 2023
03ed220
Update update1.yml
Sillah-Babar Feb 24, 2023
5942354
changes
Sillah-Babar Feb 24, 2023
d0b1c02
tests
Sillah-Babar Feb 24, 2023
6b96e5b
Changes to branches
Sillah-Babar Feb 24, 2023
4177f02
Merge branch 'sillah-tests' of https://github.com/Aliza-adnan1/AlgoBo…
Sillah-Babar Feb 24, 2023
059d830
yml changed
Sillah-Babar Feb 24, 2023
546d134
Merge pull request #8 from Aliza-adnan1/sillah-tests
Sillah-Babar Feb 24, 2023
8059698
Update Stack.py
Aliza-adnan1 Feb 24, 2023
c4ada73
Rename sillah-workflow.yml to update1.yml
Sillah-Babar Feb 24, 2023
8f74052
Update update1.yml
Sillah-Babar Feb 24, 2023
4397025
Merge pull request #4 from Aliza-adnan1/development
Sillah-Babar Feb 24, 2023
df73b5a
Update Stack.py
Aliza-adnan1 Feb 24, 2023
9f44261
Create codeql.yml
Sillah-Babar Feb 24, 2023
b425df0
Update codeql.yml
Sillah-Babar Feb 24, 2023
ec049e2
Add files via upload
Sillah-Babar Feb 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '36 14 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ['python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
41 changes: 41 additions & 0 deletions .github/workflows/update1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Push Event Workflow

on: push
jobs:
unit-testing:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: Install Package
run: pip install pytest

- name: Lint with flake8
id: flake8
continue-on-error: true
run: |
# fail if there are any flake8 errors
flake8 . --count --max-complexity=15 --max-line-length=127 --statistics
- name: Check if 'Lint with flake8' step failed
if: steps.flake8.outcome != 'success'
run: |
echo "flake8 fails"
# - name: flake8
# run: py-actions/flake8@v2

- name: Run tests
run: pytest stack_test.py
- name: Run tests2
run: pytest tests/QuickSort_test.py
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.md
*.txt
*.pytest_cache
*__pycache__
Binary file added 19i2029_19i1654_AI-J.pdf
Binary file not shown.
14 changes: 0 additions & 14 deletions python/Stack/Stack.py → Stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,3 @@ def peek(self):
def size(self):
return len(self.stack)


if __name__ == "__main__":
st = Stack()
st.pop() # Checking underflow condition
st.push(10)
st.push(20)
st.push(30)
st.push(40)
st.push(50)
st.push(60) # Checking overflow condition
print(st.size())
st.pop()
st.pop()
print(st.peek())
Empty file added python/__init__.py
Empty file.
Binary file added python/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
2 changes: 2 additions & 0 deletions python/sorting/QuickSort.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from numpy import random
from random import randint
def quicksort(array):
# If the input array contains fewer than two elements,
# then return it as the result of the function
Expand Down
Empty file added python/sorting/__init__.py
Empty file.
Binary file not shown.
Binary file added python/sorting/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
30 changes: 30 additions & 0 deletions python/string algorithms/.github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Push Event Workflow

on: push
jobs:
unit-testing:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: Install Package
run: pip install pytest

- name: flake8
run: py-actions/flake8@v2

- name: Run tests
run: pytest reverse_recursion_test.py

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
String = str(input("Enter a string: "))


def reverse(word):
size = len(word)
if size == 0 :
return
last_char = word[size-1]
print(last_char,end='')

return reverse(word[0:size-1])

reverse(String)

7 changes: 7 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
numpy
pandas
pillow
scipy
matplotlib
plotly
pytest
8 changes: 8 additions & 0 deletions stack_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from Stack import Stack

def test_stack_pop():
obj=Stack()
obj.push(10)
obj.push(20)
obj.push(30)
assert obj.peek()==30
49 changes: 49 additions & 0 deletions tests/QuickSort_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

from python.sorting.QuickSort import quicksort

import numpy as np
def asc_sorted(array):
check=True
print(array)
for i in range(len(array)):
if(i<len(array)-1):
if(array[i]>array[i+1]):
check=False
return check
return check

def test_nums():
array=[3,5,7,92,7,9]

array=quicksort(array)
isSorted=asc_sorted(array)
assert isSorted == True, "Test Passed for Normal Numbers"

def test_negative_nums():
array=[-3,-5,-7,-92,-7,-9]
array=quicksort(array)
isSorted=asc_sorted(array)
assert isSorted == True, "Test Passed for Negative Numbers"

def test_random_nums():
arr = np.random.randint(0,10,50)
arr=quicksort(arr)
isSorted=asc_sorted(arr)
assert isSorted == True, "Test Passed for Random Numbers"


def test_random_float():
low=0
high=300
size=60
arr=[np.random.uniform(low,high) for _ in range(size)]
arr=quicksort(arr)
isSorted=asc_sorted(arr)
assert isSorted == True, "Test Passed for Random float Numbers"


if __name__ == "__main__":
test_negative_nums()
test_random_float()
test_random_nums()
test_nums()
Empty file added tests/__init__.py
Empty file.
Binary file not shown.
Binary file added tests/__pycache__/__init__.cpython-311.pyc
Binary file not shown.