Some directories had a capital in their name [fixed]. Added a recursive factorial algorithm. (#763)

* Renaming directories
* Adding a recursive factorial algorithm
This commit is contained in:
Vysor
2019-04-23 00:53:56 +10:00
committed by John Law
parent 48bba495ae
commit df04d94543
36 changed files with 13 additions and 0 deletions

31
graphs/graph_list.py Normal file
View File

@ -0,0 +1,31 @@
from __future__ import print_function
class Graph:
def __init__(self, vertex):
self.vertex = vertex
self.graph = [[0] for i in range(vertex)]
def add_edge(self, u, v):
self.graph[u - 1].append(v - 1)
def show(self):
for i in range(self.vertex):
print('%d: '% (i + 1), end=' ')
for j in self.graph[i]:
print('%d-> '% (j + 1), end=' ')
print(' ')
g = Graph(100)
g.add_edge(1,3)
g.add_edge(2,3)
g.add_edge(3,4)
g.add_edge(3,5)
g.add_edge(4,5)
g.show()