Skip to content

Improved Code and removed warnings #482

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 3 commits into from
Oct 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Graphs/ArticulationPoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def dfs(root, at, parent, outEdgeCount):

for x in range(len(isArt)):
if isArt[x] == True:
print(x, end=" ")
print(x)

# Adjacency list of graph
l = {0:[1,2], 1:[0,2], 2:[0,1,3,5], 3:[2,4], 4:[3], 5:[2,6,8], 6:[5,7], 7:[6,8], 8:[5,7]}
Expand Down
4 changes: 2 additions & 2 deletions Graphs/MinimumSpanningTree_Prims.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def deleteMinimum(heap, positions):
return TreeEdges

# < --------- Prims Algorithm --------- >
n = int(input("Enter number of vertices: "))
e = int(input("Enter number of edges: "))
n = int(raw_input("Enter number of vertices: "))
e = int(raw_input("Enter number of edges: "))
adjlist = defaultdict(list)
for x in range(e):
l = [int(x) for x in input().split()]
Expand Down
2 changes: 1 addition & 1 deletion Maths/FibonacciSequenceRecursion.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def isPositiveInteger(limit):
def main():
limit = int(input("How many terms to include in fibonacci series: "))
if isPositiveInteger(limit):
print(f"The first {limit} terms of the fibonacci series are as follows:")
print("The first {limit} terms of the fibonacci series are as follows:")
print([recur_fibo(n) for n in range(limit)])
else:
print("Please enter a positive integer: ")
Expand Down
3 changes: 3 additions & 0 deletions Neural_Network/bpnn.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/python
# encoding=utf8

'''

A Framework of Back Propagation Neural Network(BP) model
Expand Down
2 changes: 1 addition & 1 deletion Project Euler/Problem 02/sol2.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ def fib(n):
ls = []
for _ in range(T):
fib(int(input().strip()))
print(*ls, sep = '\n')
print(ls, sep = '\n')
2 changes: 1 addition & 1 deletion Project Euler/Problem 03/sol1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The prime factors of 13195 are 5,7,13 and 29. What is the largest prime factor of a given number N?
e.g. for 10, largest prime factor = 5. For 17, largest prime factor = 17.
'''
from __future__ import print_function
from __future__ import print_function, division

import math

Expand Down
6 changes: 5 additions & 1 deletion data_structures/Graph/BreadthFirstSearch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Author: OMKAR PATHAK
#!/usr/bin/python
# encoding=utf8

""" Author: OMKAR PATHAK """

from __future__ import print_function


Expand Down
5 changes: 4 additions & 1 deletion data_structures/Graph/DepthFirstSearch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Author: OMKAR PATHAK
#!/usr/bin/python
# encoding=utf8

""" Author: OMKAR PATHAK """
from __future__ import print_function


Expand Down
3 changes: 3 additions & 0 deletions data_structures/Graph/Graph.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/python
# encoding=utf8

from __future__ import print_function
# Author: OMKAR PATHAK

Expand Down
2 changes: 1 addition & 1 deletion data_structures/Heap/heap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python

from __future__ import print_function
from __future__ import print_function, division

try:
raw_input # Python 2
Expand Down
3 changes: 3 additions & 0 deletions dynamic_programming/fastfibonacci.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/python
# encoding=utf8

"""
This program calculates the nth Fibonacci number in O(log(n)).
It's possible to calculate F(1000000) in less than a second.
Expand Down
2 changes: 1 addition & 1 deletion machine_learning/gradient_descent.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Implementation of gradient descent algorithm for minimizing cost of a linear hypothesis function.
"""
from __future__ import print_function
from __future__ import print_function, division
import numpy

# List of input, output pairs
Expand Down
6 changes: 4 additions & 2 deletions other/Fischer-Yates_Shuffle.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
'''
#!/usr/bin/python
# encoding=utf8
"""
The Fisher–Yates shuffle is an algorithm for generating a random permutation of a finite sequence.
For more details visit
wikipedia/Fischer-Yates-Shuffle.
'''
"""
import random

def FYshuffle(LIST):
Expand Down
3 changes: 3 additions & 0 deletions other/sierpinski_triangle.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/python
# encoding=utf8

'''Author Anurag Kumar | anuragkumarak95@gmail.com | git/anuragkumarak95

Simple example of Fractal generation using recursive function.
Expand Down