Skip to content

[pull] master from geekcomputers:master #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 41 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3c9ac75
Merge pull request #2 from geekcomputers/master
muzakkirsaifi123 Mar 30, 2023
705025c
update the code
muzakkirsaifi123 Mar 30, 2023
914edd0
update the code as per user need
muzakkirsaifi123 Mar 31, 2023
020e011
chages in github action
muzakkirsaifi123 Mar 31, 2023
7b12f0f
chages in github action
muzakkirsaifi123 Mar 31, 2023
9e3b653
update in code
muzakkirsaifi123 Mar 31, 2023
23aaa24
Merge pull request #1879 from muzakkirsaifi123/file_handler1
geekcomputers Apr 1, 2023
e6ce4e9
Merge pull request #1878 from muzakkirsaifi123/user-interactive
geekcomputers Apr 1, 2023
7d0e718
Merge pull request #1877 from muzakkirsaifi123/file_handler
geekcomputers Apr 1, 2023
9e6531d
Bump pillow from 9.4.0 to 9.5.0
dependabot[bot] Apr 3, 2023
846769d
Merge pull request #1881 from geekcomputers/dependabot/pip/pillow-9.5.0
geekcomputers Apr 6, 2023
b947a68
Added libray used in the program.
NishaantKrSingh Apr 8, 2023
e3e1af2
Merge pull request #1882 from NishaantKrSingh/patch-1
geekcomputers Apr 9, 2023
147ba68
add automail.py
Kkoder27 Apr 15, 2023
104c79f
add security warning comment to automail.py
Kkoder27 Apr 15, 2023
8b0c0b0
Merge pull request #1883 from Kkoder27/master
geekcomputers Apr 16, 2023
5e93921
Bump mediapipe from 0.9.2.1 to 0.9.3.0
dependabot[bot] Apr 18, 2023
c533b72
Update JARVIS.py
shivanshu814 Apr 18, 2023
b174cd6
Merge pull request #1884 from geekcomputers/dependabot/pip/mediapipe-…
geekcomputers Apr 19, 2023
a8986e4
Merge pull request #1885 from shivanshu814/patch-1
geekcomputers Apr 19, 2023
d240789
Bump numpy from 1.24.1 to 1.24.3
dependabot[bot] Apr 24, 2023
6c86351
Merge pull request #1886 from geekcomputers/dependabot/pip/numpy-1.24.3
geekcomputers Apr 24, 2023
efe4a7c
Bump requests from 2.28.2 to 2.29.0
dependabot[bot] Apr 26, 2023
44b8b70
Merge pull request #1888 from geekcomputers/dependabot/pip/requests-2…
geekcomputers Apr 29, 2023
21b9f80
Bump pyglet from 2.0.5 to 2.0.6
dependabot[bot] May 2, 2023
f52c652
Merge pull request #1891 from geekcomputers/dependabot/pip/pyglet-2.0.6
geekcomputers May 3, 2023
b6c20f6
Bump requests from 2.29.0 to 2.30.0
dependabot[bot] May 4, 2023
186e292
Merge pull request #1892 from geekcomputers/dependabot/pip/requests-2…
geekcomputers May 6, 2023
c159615
Bump pyglet from 2.0.6 to 2.0.7
dependabot[bot] May 9, 2023
5884730
Bump mediapipe from 0.9.3.0 to 0.10.0
dependabot[bot] May 10, 2023
a2c6c47
Update README for typos
May 12, 2023
07c16e8
typo corrected
arifaisal123 May 12, 2023
d635926
Revert "typo corrected"
arifaisal123 May 12, 2023
df58d65
typo corrected
arifaisal123 May 12, 2023
dcb8091
Merge pull request #1894 from geekcomputers/dependabot/pip/pyglet-2.0.7
geekcomputers May 12, 2023
e1e693e
Merge pull request #1895 from geekcomputers/dependabot/pip/mediapipe-…
geekcomputers May 12, 2023
bc1d1e7
Merge pull request #1898 from arifaisal123/typo
geekcomputers May 12, 2023
ab2548d
Merge pull request #1896 from RupeshBhandari/patch-1
geekcomputers May 12, 2023
33a7223
removed square root for invalid file type/ no code
arifaisal123 May 12, 2023
941511f
deleted empty folder
arifaisal123 May 13, 2023
09838a2
Merge pull request #1899 from arifaisal123/issue_solution
geekcomputers May 15, 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
41 changes: 0 additions & 41 deletions Sorting Algorithims/Quick_Sort.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
def Binary_Search(Test_arr, low, high, k):
if high >= low:
Mid = (low + high) // 2
if Test_arr[Mid] < k:
return Binary_Search(Test_arr, Mid + 1, high, k)
elif Test_arr[Mid] > k:
return Binary_Search(Test_arr, low, Mid - 1, k)
else:
return Mid
else:
return low
def Insertion_Sort(Test_arr):
for i in range(1, len(Test_arr)):
val = Test_arr[i]
j = Binary_Search(Test_arr[:i], 0, len(Test_arr[:i]) - 1, val)
Test_arr.pop(i)
Test_arr.insert(j, val)
return Test_arr
if __name__ == "__main__":
Test_list = input("Enter the list of Numbers: ").split()
Test_list = [int(i) for i in Test_list]
print(f"Binary Insertion Sort: {Insertion_Sort(Test_list)}")
def Binary_Search(Test_arr, low, high, k):
if high >= low:
Mid = (low + high) // 2
if Test_arr[Mid] < k:
return Binary_Search(Test_arr, Mid + 1, high, k)
elif Test_arr[Mid] > k:
return Binary_Search(Test_arr, low, Mid - 1, k)
else:
return Mid
else:
return low


def Insertion_Sort(Test_arr):
for i in range(1, len(Test_arr)):
val = Test_arr[i]
j = Binary_Search(Test_arr[:i], 0, len(Test_arr[:i]) - 1, val)
Test_arr.pop(i)
Test_arr.insert(j, val)
return Test_arr


if __name__ == "__main__":
Test_list = input("Enter the list of Numbers: ").split()
Test_list = [int(i) for i in Test_list]
print(f"Binary Insertion Sort: {Insertion_Sort(Test_list)}")
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
# python program for counting sort (updated)
n = int(input("please give the number of elements\n"))
print("okey now plase enter n numbers seperated by spaces")
tlist = list(map(int, input().split()))
k = max(tlist)
n = len(tlist)
def counting_sort(tlist, k, n):
"""Counting sort algo with sort in place.
Args:
tlist: target list to sort
k: max value assume known before hand
n: the length of the given list
map info to index of the count list.
Adv:
The count (after cum sum) will hold the actual position of the element in sorted order
Using the above,
"""
# Create a count list and using the index to map to the integer in tlist.
count_list = [0] * (k + 1)
# iterate the tgt_list to put into count list
for i in range(0, n):
count_list[tlist[i]] += 1
# Modify count list such that each index of count list is the combined sum of the previous counts
# each index indicate the actual position (or sequence) in the output sequence.
for i in range(1, k + 1):
count_list[i] = count_list[i] + count_list[i - 1]
flist = [0] * (n)
for i in range(n - 1, -1, -1):
count_list[tlist[i]] = count_list[tlist[i]] - 1
flist[count_list[tlist[i]]] = tlist[i]
return flist
flist = counting_sort(tlist, k, n)
print(flist)
# python program for counting sort (updated)
n = int(input("please give the number of elements\n"))
print("okey now plase enter n numbers seperated by spaces")
tlist = list(map(int, input().split()))
k = max(tlist)
n = len(tlist)


def counting_sort(tlist, k, n):

"""Counting sort algo with sort in place.
Args:
tlist: target list to sort
k: max value assume known before hand
n: the length of the given list
map info to index of the count list.
Adv:
The count (after cum sum) will hold the actual position of the element in sorted order
Using the above,

"""

# Create a count list and using the index to map to the integer in tlist.
count_list = [0] * (k + 1)

# iterate the tgt_list to put into count list
for i in range(0, n):
count_list[tlist[i]] += 1

# Modify count list such that each index of count list is the combined sum of the previous counts
# each index indicate the actual position (or sequence) in the output sequence.
for i in range(1, k + 1):
count_list[i] = count_list[i] + count_list[i - 1]

flist = [0] * (n)
for i in range(n - 1, -1, -1):
count_list[tlist[i]] = count_list[tlist[i]] - 1
flist[count_list[tlist[i]]] = tlist[i]

return flist


flist = counting_sort(tlist, k, n)
print(flist)
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
# Python program for implementation of heap Sort
# To heapify subtree rooted at index i.
# n is size of heap
def heapify(arr, n, i):
largest = i # Initialize largest as root
l = 2 * i + 1 # left = 2*i + 1
r = 2 * i + 2 # right = 2*i + 2
# See if left child of root exists and is
# greater than root
if l < n and arr[i] < arr[l]:
largest = l
# See if right child of root exists and is
# greater than root
if r < n and arr[largest] < arr[r]:
largest = r
# Change root, if needed
if largest != i:
arr[i], arr[largest] = arr[largest], arr[i] # swap
# Heapify the root.
heapify(arr, n, largest)
# The main function to sort an array of given size
def heapSort(arr):
n = len(arr)
# Build a maxheap.
# Since last parent will be at ((n//2)-1) we can start at that location.
for i in range(n // 2 - 1, -1, -1):
heapify(arr, n, i)
# One by one extract elements
for i in range(n - 1, 0, -1):
arr[i], arr[0] = arr[0], arr[i] # swap
heapify(arr, i, 0)
# Driver code to test above
arr = [12, 11, 13, 5, 6, 7]
heapSort(arr)
n = len(arr)
print("Sorted array is")
for i in range(n):
print("%d" % arr[i]),
# Python program for implementation of heap Sort

# To heapify subtree rooted at index i.
# n is size of heap
def heapify(arr, n, i):
largest = i # Initialize largest as root
l = 2 * i + 1 # left = 2*i + 1
r = 2 * i + 2 # right = 2*i + 2

# See if left child of root exists and is
# greater than root
if l < n and arr[i] < arr[l]:
largest = l

# See if right child of root exists and is
# greater than root
if r < n and arr[largest] < arr[r]:
largest = r

# Change root, if needed
if largest != i:
arr[i], arr[largest] = arr[largest], arr[i] # swap

# Heapify the root.
heapify(arr, n, largest)


# The main function to sort an array of given size
def heapSort(arr):
n = len(arr)

# Build a maxheap.
# Since last parent will be at ((n//2)-1) we can start at that location.
for i in range(n // 2 - 1, -1, -1):
heapify(arr, n, i)

# One by one extract elements
for i in range(n - 1, 0, -1):
arr[i], arr[0] = arr[0], arr[i] # swap
heapify(arr, i, 0)


# Driver code to test above
arr = [12, 11, 13, 5, 6, 7]
heapSort(arr)
n = len(arr)
print("Sorted array is")
for i in range(n):
print("%d" % arr[i]),
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
def Linear_Search(Test_arr, val):
index = 0
for i in range(len(Test_arr)):
if val > Test_arr[i]:
index = i + 1
return index
def Insertion_Sort(Test_arr):
for i in range(1, len(Test_arr)):
val = Test_arr[i]
j = Linear_Search(Test_arr[:i], val)
Test_arr.pop(i)
Test_arr.insert(j, val)
return Test_arr
if __name__ == "__main__":
Test_list = input("Enter the list of Numbers: ").split()
Test_list = [int(i) for i in Test_list]
print(f"Binary Insertion Sort: {Insertion_Sort(Test_list)}")
def Linear_Search(Test_arr, val):
index = 0
for i in range(len(Test_arr)):
if val > Test_arr[i]:
index = i + 1
return index


def Insertion_Sort(Test_arr):
for i in range(1, len(Test_arr)):
val = Test_arr[i]
j = Linear_Search(Test_arr[:i], val)
Test_arr.pop(i)
Test_arr.insert(j, val)
return Test_arr


if __name__ == "__main__":
Test_list = input("Enter the list of Numbers: ").split()
Test_list = [int(i) for i in Test_list]
print(f"Binary Insertion Sort: {Insertion_Sort(Test_list)}")
Loading