Skip to content

Instantly share code, notes, and snippets.

View ssundarraj's full-sized avatar
🧰

Sriram Sundarraj ssundarraj

🧰
View GitHub Profile
# One Dimensional array:
n = 10
a = [0] * n
# Two Dimensional array:
N = 5
M = 4
A = [[0] * N for _ in range(M)]
graph = {'A': ['B', 'C'],
'B': ['C', 'D'],
'C': ['D'],
'D': ['C'],
'E': ['F'],
'F': ['C']}
class BinaryTreeNode(object):
def __init__(self, data=None, left=None, right=None):
self.data = data
self.left = left
self.right = right
class TreeNode(object):
def __init__(self, data=None, children=[]):
self.data = data
@ssundarraj
ssundarraj / LinkedList.py
Last active January 3, 2016 19:02
python_ds
class LinkedListNode(object):
def __init__(self, data=None, next_node=None):
self.next_node = next_node
self.data = data
class LinkedList(object):
def __init__(self):
self.head = None
@ssundarraj
ssundarraj / .vimrc
Last active April 26, 2018 03:19
ssundarraj vimrc
" .vimrc
" Author: Sriram Sundarraj (ssundarraj)
syntax on
set number
nmap <C-N><C-N> :set invnumber<CR>
set cursorline
colorscheme monokai
set laststatus=2
set tabstop=2
@ssundarraj
ssundarraj / .pypirc
Created June 1, 2015 11:58
A sample .pypirc with pypi and pypi test.
[distutils]
index-servers =
pypi
pypitest
[pypi]
repository: http://pypi.python.org/pypi
username: <username>
password: <pass>