Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
d8a0afc
fix error in preshow
rafaelleru Jul 7, 2017
8384cbb
finish AVL
rafaelleru Jul 7, 2017
67f23f5
rotate left almost working
rafaelleru Jul 7, 2017
d8cd33a
using python properties
rafaelleru Jul 8, 2017
8e41aca
node now eses pythonproperties
rafaelleru Jul 10, 2017
e1befed
add bp neural network with 3 layers
RiptideBo Sep 21, 2017
53b6fe1
improve
RiptideBo Sep 22, 2017
0e0e75d
improve
RiptideBo Sep 22, 2017
e1e897b
Merge pull request #114 from RiptideBo/master
AnupKumarPanwar Sep 22, 2017
a38e684
Merge pull request #115 from RiptideBo/stephen_branch
AnupKumarPanwar Sep 22, 2017
52ee9a1
commit convolution_neural_network.py
RiptideBo Sep 22, 2017
6e61ac1
commit convolution_neural_network.py
RiptideBo Sep 22, 2017
da449e0
Merge pull request #1 from RiptideBo/stephen_branch
RiptideBo Sep 22, 2017
e4d537a
Merge remote-tracking branch 'upstream/master'
RiptideBo Sep 22, 2017
42c5863
Merged Graphs
dhavdc Sep 28, 2017
d3f3a88
Merge pull request #120 from dhavdc/master
dynamitechetan Sep 28, 2017
1958cf2
added timsort.py
theycallmemac Sep 28, 2017
8bae14b
Update .travis.yml
AnupKumarPanwar Sep 29, 2017
aa8485b
Delete .travis.yml
AnupKumarPanwar Sep 29, 2017
edcf6d5
#130 fixed radix sort for python 3
KuLi Sep 29, 2017
4d4b0ff
Added Dijkstra Algorithm
malikshubham827 Sep 30, 2017
2480eac
Adding Euclidean GCD algorithm
JuantAldea Oct 1, 2017
a97ab2f
Update timsort.py
theycallmemac Oct 1, 2017
6903d95
AVL done
rafaelleru Oct 2, 2017
07fb7d6
added k means clustering algorithm, usage doc inside.
anuragkumarak95 Oct 2, 2017
9ba6426
Added A* Algorithm
Oct 3, 2017
271cc48
Update A*.py
rudrasohan Oct 3, 2017
46b82fa
Added Next Greater Element
rajnishyadav321 Oct 4, 2017
17e1a92
Refactor Stack
Oct 6, 2017
e8d0c7e
Added Code in Dynamic Programming section for Longest Strictly Increa…
aravindiiitb Oct 6, 2017
2a916b0
Delete P01_BreadthFirstSearch.py
b1o0d4x3 Oct 6, 2017
d33044e
Delete P02_DepthFirstSearch.py
b1o0d4x3 Oct 6, 2017
3ecb193
Merge pull request #148 from b1o0d4x3/master
AnupKumarPanwar Oct 7, 2017
014786e
Fix: typo in multiple files.
KyleScharnhorst Oct 7, 2017
b695175
binary exponentiation
chinmoy159 Oct 8, 2017
677dfe9
Delete binary_exponentiation.java
chinmoy159 Oct 8, 2017
a36ca7c
Create binary_exponentiation.py
chinmoy159 Oct 8, 2017
f4c6578
Binary Exponentiation for a^b
chinmoy159 Oct 8, 2017
f5917f5
Binary Exponentiation for Multiplication
chinmoy159 Oct 8, 2017
0393c5a
Update binary_exponentiation.py
chinmoy159 Oct 8, 2017
7447a9f
Added Ternary Search Algorithm
DTBUday Oct 9, 2017
8fb1eb7
Implementation of a regression tree in python
nbrgr Oct 9, 2017
37967bd
Fixed case where function didn't return where it should
nbrgr Oct 9, 2017
cb3ff4a
Create quick_select.py
fickleEfrit Oct 9, 2017
dc5e86b
Fixed compilation errors, fixes for readability/convention, changed d…
Oct 10, 2017
ab058ab
changed rigt->right, a typo fix.
Oct 10, 2017
8f71b30
Fixed binary search to correctly recurse to left half and right half
TaylorL19 Oct 10, 2017
a3b72c5
Merge pull request #155 from TaylorL19/master
dynamitechetan Oct 10, 2017
48dc64f
Merge pull request #154 from alveeno/master
dynamitechetan Oct 10, 2017
59fc956
Merge pull request #153 from fickleEfrit/patch-1
dynamitechetan Oct 10, 2017
f9156cf
Merge pull request #152 from nbrgr/DecisionTree
dynamitechetan Oct 10, 2017
875c6cd
Add Linear Congruential Generator
TobCar Oct 11, 2017
7c9a07c
Merge remote-tracking branch 'upstream/master'
RiptideBo Oct 11, 2017
a07baad
Added fastfibonacci.py
Oct 12, 2017
86a5b03
Recursive solution to insert_tail in singly_LinkedList
coreyhu Oct 13, 2017
e021179
Changed the typographical error (#132)
nandujkishor Oct 13, 2017
81ab324
Revert "There were 2 codes for BFS and DFS in data-structure/Graph." …
sachinarora707 Oct 13, 2017
974acef
Deleting duplicate BFS and DFS files. (#164)
sachinarora707 Oct 13, 2017
85c1e03
Merge pull request #149 from KyleScharnhorst/master
sachinarora707 Oct 13, 2017
35d3873
Add counting sort
andrealmeid Oct 14, 2017
eb8375d
Commented travis tag
harshildarji Oct 14, 2017
ec9fdaa
Merge pull request #160 from kiandru/fastfibonacci
harshildarji Oct 14, 2017
db3b628
Merge pull request #165 from andrealmeid/master
harshildarji Oct 14, 2017
d7fccf5
Updated README.md
yeggasd Oct 14, 2017
944c128
Merge pull request #168 from yeggasd/master
sachinarora707 Oct 14, 2017
2046a7b
Merge pull request #116 from RiptideBo/master
harshildarji Oct 15, 2017
4c9efea
Merge pull request #123 from theycallmemac/master
harshildarji Oct 15, 2017
d70b926
fixed spelling of coma to comma
sarbajitsaha Oct 15, 2017
6d19270
added interpolation search
sarbajitsaha Oct 15, 2017
464408e
Merge pull request #169 from sarbajitsaha/master
AnupKumarPanwar Oct 15, 2017
aab6d58
Merge pull request #134 from malikshubham827/master
harshildarji Oct 16, 2017
cf7d2cb
Fix typo in traversals
agdenadel Oct 17, 2017
12a5b3a
Merge pull request #170 from agdenadel/master
AnupKumarPanwar Oct 17, 2017
54eb79f
Merge pull request #135 from KuLi/radix_sort-fix
harshildarji Oct 17, 2017
6882321
Merge pull request #136 from JuantAldea/euclidean_gcd
harshildarji Oct 17, 2017
6bc30c7
Merge pull request #139 from anuragkumarak95/master
harshildarji Oct 17, 2017
438a9c6
Merge pull request #162 from coreywho/master
harshildarji Oct 17, 2017
bb76af3
Merge pull request #140 from rudrasohan/new
harshildarji Oct 17, 2017
2b8b65a
Merge pull request #143 from rajnishyadav321/patch-1
harshildarji Oct 18, 2017
7fe8fdc
Merge pull request #138 from rafaelleru/master
harshildarji Oct 19, 2017
8ae1f24
Merge pull request #151 from DTBUday/master
harshildarji Oct 19, 2017
971d53b
Merge pull request #150 from chinmoy159/master
harshildarji Oct 19, 2017
a093f55
Merge pull request #147 from aravindiiitb/master
harshildarji Oct 19, 2017
606e696
Merge pull request #146 from chrismclennon/stack
harshildarji Oct 19, 2017
535cbb7
Merge pull request #156 from TobCar/master
harshildarji Oct 20, 2017
0dcf27f
Added basic-graphs.py with common graph algorithms
py-ranoid Oct 20, 2017
edaa2c1
Floyd Warshall Algorithm
Oct 20, 2017
d68d0ef
Add Fenwick Tree
Oct 20, 2017
29f8e5e
Create Arrays
Oct 20, 2017
e7e8558
Add Segment Tree
Oct 20, 2017
2617de8
Add Lazy Segment Tree
Oct 20, 2017
8e6db7a
Merge pull request #173 from py-ranoid/patch-1
harshildarji Oct 23, 2017
64610bc
Merge pull request #174 from SaBuZa/floyd_warshall
harshildarji Oct 24, 2017
fd4875a
Merge pull request #175 from SaBuZa/Fenwick-Tree
harshildarji Oct 24, 2017
3b69bfc
Merge pull request #176 from imcgeek/patch-1
harshildarji Oct 24, 2017
f6696d0
Merge pull request #177 from SaBuZa/Segment-Tree
harshildarji Oct 24, 2017
f07c8d5
Merge pull request #178 from SaBuZa/Lazy-Segment-Tree
harshildarji Oct 24, 2017
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
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

101 changes: 101 additions & 0 deletions Graphs/A*.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@

grid = [[0, 1, 0, 0, 0, 0],
[0, 1, 0, 0, 0, 0],#0 are free path whereas 1's are obstacles
[0, 1, 0, 0, 0, 0],
[0, 1, 0, 0, 1, 0],
[0, 0, 0, 0, 1, 0]]

'''
heuristic = [[9, 8, 7, 6, 5, 4],
[8, 7, 6, 5, 4, 3],
[7, 6, 5, 4, 3, 2],
[6, 5, 4, 3, 2, 1],
[5, 4, 3, 2, 1, 0]]'''

init = [0, 0]
goal = [len(grid)-1, len(grid[0])-1] #all coordinates are given in format [y,x]
cost = 1

#the cost map which pushes the path closer to the goal
heuristic = [[0 for row in range(len(grid[0]))] for col in range(len(grid))]
for i in range(len(grid)):
for j in range(len(grid[0])):
heuristic[i][j] = abs(i - goal[0]) + abs(j - goal[1])
if grid[i][j] == 1:
heuristic[i][j] = 99 #added extra penalty in the heuristic map


#the actions we can take
delta = [[-1, 0 ], # go up
[ 0, -1], # go left
[ 1, 0 ], # go down
[ 0, 1 ]] # go right


#function to search the path
def search(grid,init,goal,cost,heuristic):

closed = [[0 for col in range(len(grid[0]))] for row in range(len(grid))]# the referrence grid
closed[init[0]][init[1]] = 1
action = [[0 for col in range(len(grid[0]))] for row in range(len(grid))]#the action grid

x = init[0]
y = init[1]
g = 0
f = g + heuristic[init[0]][init[0]]
cell = [[f, g, x, y]]

found = False # flag that is set when search is complete
resign = False # flag set if we can't find expand

while not found and not resign:
if len(cell) == 0:
resign = True
return "FAIL"
else:
cell.sort()#to choose the least costliest action so as to move closer to the goal
cell.reverse()
next = cell.pop()
x = next[2]
y = next[3]
g = next[1]
f = next[0]


if x == goal[0] and y == goal[1]:
found = True
else:
for i in range(len(delta)):#to try out different valid actions
x2 = x + delta[i][0]
y2 = y + delta[i][1]
if x2 >= 0 and x2 < len(grid) and y2 >=0 and y2 < len(grid[0]):
if closed[x2][y2] == 0 and grid[x2][y2] == 0:
g2 = g + cost
f2 = g2 + heuristic[x2][y2]
cell.append([f2, g2, x2, y2])
closed[x2][y2] = 1
action[x2][y2] = i
invpath = []
x = goal[0]
y = goal[1]
invpath.append([x, y])#we get the reverse path from here
while x != init[0] or y != init[1]:
x2 = x - delta[action[x][y]][0]
y2 = y - delta[action[x][y]][1]
x = x2
y = y2
invpath.append([x, y])

path = []
for i in range(len(invpath)):
path.append(invpath[len(invpath) - 1 - i])
print "ACTION MAP"
for i in range(len(action)):
print action[i]

return path

a = search(grid,init,goal,cost,heuristic)
for i in range(len(a)):
print a[i]

70 changes: 0 additions & 70 deletions Graphs/Breadth_First_Search.py

This file was deleted.

32 changes: 0 additions & 32 deletions Graphs/Deep_First_Search.py

This file was deleted.

Loading