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
| # UDCG : undirected cyclic graph | |
| class Graph: | |
| def __init__(self): | |
| self.vertices = {} | |
| def add_vertex(self, key): | |
| vertex = Vertex(key) | |
| self.vertices[key] = vertex |
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
| # ===================================== | |
| import random | |
| # BST problem | |
| NODES = [] | |
| class Node: |
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
| # DFS binary tree | |
| # --------------- | |
| # DFS BINARY TREE | |
| # --------------- | |
| def dfs(tree, value): | |
| if tree.root is None: |
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
| # IDDS binary tree | |
| # ---------------- | |
| # IDDS BINARY TREE | |
| # ALGORITHMS | |
| # ---------------- | |
| # getting the maximum depth of the tree | |
| def maxDepth(node): | |
| if node is None: |
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
| # ROCK | SCISSORS | PAPER | |
| class Node: | |
| def __init__(self, data): | |
| self.data = data | |
| self._to = [] | |
| self._from = [] | |
| self.right = None |
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, value): | |
| self.left = None | |
| self.right = None | |
| self.value = value | |
| self.id = None |
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
| # WIST algo | |
| import random | |
| # creating Node class | |
| class Node: | |
| def __init__(self, data): |
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
| #[*****************************************************************************************] | |
| # http://bt3gl.github.io/black-hat-python-infinite-possibilities-with-the-scapy-module.html | |
| #[*****************************************************************************************] | |
| #!/usr/bin/python | |
| import sys | |
| from datetime import datetime |
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
| from stack import stack | |
| class BET(): | |
| class Node(): | |
| def __init__(self, value): | |
| self.value = value | |
| self.left = None | |
| self.right = None |
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
| //TODO: peer-to-peer network to communicate with other nodes, real proof-of-work according to bitcoin wiki | |
| //TODO: merkle tree for data transactions, replaceChain method, data object is not showing, timestamp | |
| //TODO: increase the amount of difficulty after a specific number of block has been mined | |
| //NOTE: Every node in the network holds a copy of the blockchain | |
| // npm install --save body-parser crypto-js ws express | |
| const SHA256 = require('crypto-js/sha256'); | |
| const express = require("express"); |