various algos implemented in php,node.js,java