Skip to content

Synchronizing with source #1

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 190 commits into from
Dec 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
190 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
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
1958cf2
added timsort.py
theycallmemac Sep 28, 2017
1f0f4b2
Fixed heading's formatting errors
Ankit-Dhankhar 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
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
14e6372
Added counting sort in python
shivams334 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
aac224d
Update radix_sort.py
satanb4 Oct 11, 2017
247089d
Update minimum_partition.py
satanb4 Oct 11, 2017
09131a7
implemented jump search
senapati-deepak Oct 12, 2017
a07baad
Added fastfibonacci.py
Oct 12, 2017
5d83eb7
Add Dijkstra's Algorithm
arpanjain97 Oct 13, 2017
176c330
Add Bellman-Ford Algorithm
arpanjain97 Oct 13, 2017
00575aa
Add Floyd-Warshall Algorithm
arpanjain97 Oct 13, 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
123b8a3
added simple chaos machine impl. to hashes/
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
1f8693d
Merge pull request #1 from TheAlgorithms/master
anuragkumarak95 Oct 18, 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
fe7b86c
Add files via upload
shivams334 Oct 20, 2017
b0d5301
fixed issue#171
itsdanni Oct 20, 2017
44ad272
Merge pull request #2 from TheAlgorithms/master
anuragkumarak95 Oct 20, 2017
226a0a4
Adding reverse() to singly-linked list
tonydelanuez Oct 22, 2017
850953c
Two-sum, common interview problem.
tonydelanuez Oct 22, 2017
0ad029c
Added getNode function and made changes to insert function
pablo9891 Oct 22, 2017
3786c0d
Deleted binary_seach_tree
pablo9891 Oct 22, 2017
da58cd9
added Sierpinski Triangle generation module(fractal structures).
anuragkumarak95 Oct 23, 2017
b96412c
Merge branch 'master' into patch-1
satanb4 Oct 23, 2017
8e6db7a
Merge pull request #173 from py-ranoid/patch-1
harshildarji Oct 23, 2017
7180f08
Created Union-Find algorithm
gilbertoalexsantos Oct 24, 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
b2d165d
Merge pull request #1 from TheAlgorithms/master
rudrasohan Oct 24, 2017
88c881d
Changed Filename from A*.py to a_star.py
rudrasohan Oct 24, 2017
70c11da
Merge pull request #188 from rudrasohan/fix_name
sachinarora707 Oct 24, 2017
b039fcb
Merge pull request #180 from mathildapurr/fix_balanced_brackets
sachinarora707 Oct 24, 2017
46c0c66
deleted A*.py
sachinarora707 Oct 24, 2017
b50827f
Merge pull request #189 from TheAlgorithms/sachinarora707-patch-1
sachinarora707 Oct 24, 2017
848432c
Project Euler Problems Added.
sachinarora707 Oct 24, 2017
1aa3717
Merge pull request #191 from sachinarora707/master
dynamitechetan Oct 24, 2017
7284714
Project Euler Solutions Added.
sachinarora707 Oct 24, 2017
9bc80ea
Added Dequeue in Python
97arushisharma Oct 24, 2017
fb347ac
Merge branch 'master' of https://github.com/jyotsana19/Python
97arushisharma Oct 24, 2017
96536ad
add coin change problem
Oct 25, 2017
53ce9b8
fix typo
Oct 25, 2017
6bdf4fc
Merge pull request #182 from tonydelanuez/patch-1
harshildarji Oct 25, 2017
60a42cc
Merge pull request #183 from tonydelanuez/patch-2
harshildarji Oct 25, 2017
55ebf70
Merge pull request #184 from pablo9891/master
harshildarji Oct 26, 2017
a11d3b5
Merge pull request #185 from anuragkumarak95/master
harshildarji Oct 26, 2017
8f3abf5
Merge pull request #186 from gilbertoalexsantos/union-find
harshildarji Oct 26, 2017
07e8e25
Merge pull request #190 from jyotsana19/master
harshildarji Oct 26, 2017
dc5c576
Merge pull request #192 from sachinarora707/master
harshildarji Oct 26, 2017
f1621c4
[other] Added Conway's Game of Life Experiment.
anuragkumarak95 Oct 26, 2017
1e9d903
Merge pull request #3 from TheAlgorithms/master
anuragkumarak95 Oct 26, 2017
20a4577
Add a soution of ProjectEuler Problem 13
bT-53 Oct 27, 2017
3cae796
Create scc_kosaraju.py
bT-53 Oct 27, 2017
5c10a29
Merge pull request #196 from bT-53/patch-1
dynamitechetan Oct 27, 2017
ad935df
Merge pull request #179 from Shivams334/master
harshildarji Oct 27, 2017
8cd5157
Added Multi Heuristic Astar
yashasvi97 Oct 27, 2017
e07e0cb
add minimum spanning tree kruskal
First4196 Oct 27, 2017
6393251
add newline at the end
First4196 Oct 27, 2017
8c5fd4b
Create cyclesort.py
Oct 27, 2017
54700f2
Added delete function
pablo9891 Oct 28, 2017
f766bb4
Added delete function
pablo9891 Oct 28, 2017
9d88246
Finished delete function and added some prints functions too
pablo9891 Oct 28, 2017
75af340
ROT13
t0rr3sp3dr0 Oct 29, 2017
21e8724
Merge pull request #193 from erdenezul/coin_change_problem
harshildarji Oct 30, 2017
a5ccc42
Merge pull request #194 from anuragkumarak95/master
harshildarji Oct 30, 2017
4945623
Merge pull request #195 from bT-53/master
harshildarji Oct 30, 2017
aa15ab8
Merge pull request #197 from yashasvi97/yashasvi97-MHAstar
harshildarji Oct 31, 2017
92bf7a6
Merge pull request #198 from First4196/master
harshildarji Oct 31, 2017
ac33016
Merge pull request #199 from honeycoder96/patch-1
harshildarji Oct 31, 2017
9dfd0a6
Merge pull request #200 from pablo9891/master
harshildarji Oct 31, 2017
991d09a
Merge pull request #201 from t0rr3sp3dr0/master
harshildarji Oct 31, 2017
bb3287a
Merge pull request #157 from Sayan97/patch-1
harshildarji Nov 1, 2017
3c4c7eb
refactor longest common subsequence problem
Nov 1, 2017
823ce64
Merge pull request #1 from TheAlgorithms/master
satanb4 Nov 1, 2017
8e00180
Merge pull request #166 from maciejczyzewski/master
harshildarji Nov 2, 2017
3a63814
Merge pull request #203 from erdenezul/refactor_longest_common_subseq…
dynamitechetan Nov 2, 2017
e0733c2
add even tree problem
Nov 3, 2017
4306482
Merge pull request #161 from arpanjain97/master
harshildarji Nov 3, 2017
7f87515
Merge pull request #159 from Deepak345/master
harshildarji Nov 3, 2017
247f1b7
created sol1.py
Thejus-Paul Nov 8, 2017
3fae059
Added Question 9
Nov 9, 2017
495fdc1
Added a python implementation of knuth-morris-pratt string search algo
damelLP Nov 11, 2017
0f78cd6
Project Euler Solution Added
Nov 12, 2017
d97b34d
Send & receive files via ftp
nautiyaldeepak Nov 12, 2017
c522dda
Update ftp_send_receive.py
nautiyaldeepak Nov 12, 2017
b26998f
Merge pull request #208 from damelLP/add_string_algos
harshildarji Nov 15, 2017
b2beb8d
Merge pull request #209 from DeepakNautiyal987/master
harshildarji Nov 15, 2017
227e5a1
Merge pull request #206 from Thejus-Paul/master
harshildarji Nov 15, 2017
990b367
Merge pull request #205 from Thejus-Paul/patch-1
harshildarji Nov 15, 2017
a03b2ea
Merge pull request #204 from erdenezul/even_tree_problem
harshildarji Nov 15, 2017
80bdfbb
add mean bias deviation in scoring functions
himangSharatun Nov 18, 2017
50d3956
primelib
Nov 18, 2017
52d160e
Merge pull request #1 from christianbender/christianbender-primelib
Nov 18, 2017
567f2ad
Correction: Remove semicolons
Nov 19, 2017
a5c954f
Correction: File solv3.py
Nov 19, 2017
8d9da8f
Correction: File solv01.py
Nov 19, 2017
01f48e7
Correction: File solv01.py
Nov 19, 2017
c787a22
Problem 16 Added
Nov 19, 2017
abe0f29
Problem 29 -- Project Euler
Nov 19, 2017
01ae338
Delete main.py
Nov 19, 2017
31ebde6
Problem 29
Nov 19, 2017
f920e2a
ftp client server connection
nautiyaldeepak Nov 21, 2017
bc53e2e
import numpy as np
Nov 24, 2017
0337441
Added Solution
Nov 27, 2017
491439a
Merge pull request #129 from Balance-Breaker/master
harshildarji Nov 28, 2017
f0addfb
Merge pull request #158 from Sayan97/patch-3
harshildarji Nov 28, 2017
7bb26e9
Merge pull request #211 from christianbender/master
harshildarji Nov 28, 2017
777d947
Merge pull request #210 from himangSharatun/master
harshildarji Nov 28, 2017
9714aa3
Merge pull request #213 from Thejus-Paul/master
harshildarji Nov 28, 2017
f069c20
Easier Solution To Problem 7
Richienb Nov 29, 2017
25104f3
Merge pull request #216 from nautiyaldeepak/master
harshildarji Nov 29, 2017
9168237
Merge pull request #217 from cclauss/patch-2
harshildarji Dec 11, 2017
59d7da3
Merge pull request #224 from Sayan97/master
harshildarji Dec 11, 2017
a14ea99
Merge pull request #225 from Richienb/patch-1
harshildarji Dec 11, 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
58 changes: 58 additions & 0 deletions File_Transfer_Protocol/ftp_client_server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# server

import socket # Import socket module

port = 60000 # Reserve a port for your service.
s = socket.socket() # Create a socket object
host = socket.gethostname() # Get local machine name
s.bind((host, port)) # Bind to the port
s.listen(5) # Now wait for client connection.

print 'Server listening....'

while True:
conn, addr = s.accept() # Establish connection with client.
print 'Got connection from', addr
data = conn.recv(1024)
print('Server received', repr(data))

filename='mytext.txt'
f = open(filename,'rb')
l = f.read(1024)
while (l):
conn.send(l)
print('Sent ',repr(l))
l = f.read(1024)
f.close()

print('Done sending')
conn.send('Thank you for connecting')
conn.close()


# client side server

import socket # Import socket module

s = socket.socket() # Create a socket object
host = socket.gethostname() # Get local machine name
port = 60000 # Reserve a port for your service.

s.connect((host, port))
s.send("Hello server!")

with open('received_file', 'wb') as f:
print 'file opened'
while True:
print('receiving data...')
data = s.recv(1024)
print('data=%s', (data))
if not data:
break
# write data to a file
f.write(data)

f.close()
print('Successfully get the file')
s.close()
print('connection closed')
36 changes: 36 additions & 0 deletions File_Transfer_Protocol/ftp_send_receive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""
File transfer protocol used to send and receive files using FTP server.
Use credentials to provide access to the FTP client

Note: Do not use root username & password for security reasons
Create a seperate user and provide access to a home directory of the user
Use login id and password of the user created
cwd here stands for current working directory
"""

from ftplib import FTP
ftp = FTP('xxx.xxx.x.x') """ Enter the ip address or the domain name here """
ftp.login(user='username', passwd='password')
ftp.cwd('/Enter the directory here/')

"""
The file which will be received via the FTP server
Enter the location of the file where the file is received
"""

def ReceiveFile():
FileName = 'example.txt' """ Enter the location of the file """
LocalFile = open(FileName, 'wb')
ftp.retrbinary('RETR ' + filename, LocalFile.write, 1024)
ftp.quit()
LocalFile.close()

"""
The file which will be sent via the FTP server
The file send will be send to the current working directory
"""

def SendFile():
FileName = 'example.txt' """ Enter the name of the file """
ftp.storbinary('STOR ' + FileName, open(FileName, 'rb'))
ftp.quit()
101 changes: 101 additions & 0 deletions Graphs/a_star.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]

Loading