Skip to content

Instantly share code, notes, and snippets.

View deusmachinea's full-sized avatar
🎯
focussing

deus_machinea deusmachinea

🎯
focussing
View GitHub Profile
//BFS to print the tree in breadth first fashion
func BFS(tree *Tree) []int {
queue := []*Tree{}
queue = append(queue, tree)
result := []int{}
return BFSUtil(queue, result)
}
//BFSUtil to help BFS
package main
import (
"errors"
"fmt"
)
//BFS to print the tree in breadth first fashion
func BFS(tree *Tree) []int {
package main
import (
"errors"
"fmt"
)
//Tree struct to define the tree
type Tree struct {
Value int
package main
import (
"fmt"
)
// Round returns the nearest integer, rounding ties away from zero.
func merge(a, b []int) []int {
@deusmachinea
deusmachinea / lottery.sol
Created January 25, 2019 20:44
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.17+commit.bdeb9e52.js&optimize=false&gist=
pragma solidity ^0.4.17;
contract Lottery{
address public manager;
address[] public players;
function Lottery() public {
@deusmachinea
deusmachinea / convolution.ipynb
Last active April 24, 2018 20:34
Demo for implementing 2D convolution in python and numpy.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@deusmachinea
deusmachinea / lassoregression.ipynb
Last active April 24, 2018 20:35
Lasso regression
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.