Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Devesh Sawant dsaw

I may be slow to respond.
Block or report user

Report or block dsaw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
dsaw /
Created Apr 12, 2020 — forked from pavlin-policar/
Python implementation of max heap/priority queue
class MaxHeap:
def __init__(self, collection=None):
self._heap = []
if collection is not None:
for el in collection:
def push(self, value):
dsaw / js_binding_rules.js
Created Oct 24, 2018
Little script to recap on this binding rules.
View js_binding_rules.js
function displaySome(blah)
var blah = "suit yourself!";
dsaw /
Created Aug 20, 2018
Memoized fibonacci in Python
# Example learned from there
def memoize(func):
cache = dict()
def memoized_func(*args):
if args in cache:
dsaw /
Created Aug 20, 2018 — forked from ChrisPenner/
Tail Recursion in Python without Introspection
from tail_recursion import tail_recursive, recurse
# Normal recursion depth maxes out at 980, this one works indefinitely
def factorial(n, accumulator=1):
if n == 0:
return accumulator
recurse(n-1, accumulator=accumulator*n)
dsaw /
Last active May 18, 2018
Straightforward implementation of 2-d tree in Python.
import unittest
## Kd-tree implementation
## 2d tree
## search, insert
class Node:
def __init__(self,x,y,cmp_x):
dsaw /
Last active May 3, 2018 — forked from mattratleph/
vimdiff cheat sheet

vimdiff cheat sheet

git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget LO or :diffget RE (the LO and RE are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)
:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)
dsaw / c++Template.cpp
Created Dec 3, 2017 — forked from kodekracker/c++Template.cpp
Basic C++ Template for Competitive Programming
View c++Template.cpp
* Note: This template uses some c++11 functions , so you have to compile it with c++11 flag.
* Example:- $ g++ -std=c++11 c++Template.cpp
* Author : Akshay Pratap Singh
* Handle: code_crack_01
/******** All Required Header Files ********/
You can’t perform that action at this time.