As a part of my course work i need to calculate the complexity of programs. I'd like to calculate the space complexity and time complexity of the below program.How do i calculate it? It would be really helpful for me if somebody can explain it in detail.
sub find_multi_string {
my ($file, @strings) = @_;
my $fh;
open ($fh, "<$file");
#store the whole file in an array
my @array = <$fh>;
for my $string (@strings) {
if (grep /$string/, @array) {
next;
} else {
die "Cannot find $string in $file";
}
}
return 1;
}