This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function(){ | |
| var canvas = document.getElementById('rectmap'); | |
| var recSize = 10; | |
| gap = 1; | |
| boardWidth = 100, | |
| boardHeight = 100; | |
| if (canvas.getContext){ | |
| var ctx = canvas.getContext('2d'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Assets of markdown files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Vertex: | |
| def __init__(self, value): | |
| self.value = value | |
| self.adjacents = [] | |
| self.state = 0 | |
| class Graph: | |
| def __init__(self): | |
| self.vertices = [] | |
| # self.edges = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Graph: | |
| def __init__(self): | |
| self.dic = {} | |
| def addVertex(self, vert): | |
| if vert not in self.dic: | |
| self.dic[vert] = [] | |
| def addEdge(self, start, end): | |
| if end not in self.dic[start]: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Graph: | |
| def __init__(self): | |
| self.dic = {} | |
| def addVertex(self, vert): | |
| if vert not in self.dic: | |
| self.dic[vert] = [] | |
| def addEdge(self, start, end): | |
| if end not in self.dic[start]: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Stack: | |
| def __init__(self): | |
| self.items = [] | |
| def push(self, item): | |
| self.items.append(item) | |
| def pop(self): | |
| return self.items.pop() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Stack: | |
| def __init__(self): | |
| self.items = [] | |
| def push(self, item): | |
| self.items.append(item) | |
| def pop(self): | |
| return self.items.pop() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Stack: | |
| def __init__(self): | |
| self.items = [] | |
| def push(self, item): | |
| self.items.append(item) | |
| def pop(self): | |
| return self.items.pop() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Basic Sorting Algorithms | |
| def bubleSort(lst): | |
| n = len(lst) | |
| for i in range(n-1): | |
| for j in range(n-1-i): | |
| if lst[j]>lst[j+1]: | |
| tmp = lst[j+1] | |
| lst[j+1] = lst[j] | |
| lst[j] = tmp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Node: | |
| def __init__(self, val): | |
| self.data = val | |
| self.next = None | |
| self.prev = None | |
| class LinkedList: | |
| def __init__(self): | |
| self.head = None | |
| self.tail = None |
NewerOlder