Skip to content

Instantly share code, notes, and snippets.

View ohoushyar's full-sized avatar

Omid Houshyar ohoushyar

View GitHub Profile
@ohoushyar
ohoushyar / inversion_count.pl
Last active August 29, 2015 14:14
Algorithms
#!/usr/bin/env perl
use strict;
use warnings;
use feature qw( say );
# my @arr = ( 4, 2, 3, 6, 5, 7, 1,);
# my @arr = (1,3,5,2,4,6);
my $verbose = 1 if ($ARGV[0] && $ARGV[0] eq '-v');
#!/usr/bin/env perl
use strict;
use warnings;
use feature qw( say );
use AnyEvent;
use AnyEvent::Strict;
use Twiggy::Server;
my $psgi_app = sub {
@ohoushyar
ohoushyar / btree_levelorder.pl
Last active December 28, 2015 19:19
Binary Tree Traversal Breadth-first
#!/usr/bin/env perl
#####################################################
# Binary Tree Traversal Breadth-first (level order)
# Author: Omid Houshyar
# Date: 11/20/2013
#####################################################
use strict;
use warnings;