Download Summary
Transcript
Testing
}
public function __destruct()
{
// intentionally left blank
}
// implement interface method
// with args like needle, haystack
public function search($substring, $buffer)
{
// reset results array
$this->results = array();
$this->substring = $substring;
$this->buffer = $buffer;
// get jump table
$this->deriveJumpTable();
$currentCharacter = strlen($this->substring) - 1;
$substringLength = strlen($this->substring);
$bufferLength = strlen($this->buffer);
while ($currentCharacter < $bufferLength) {
for ($i = $substringLength - 1; $i >= 0; $i--) {
// character matches, continue ...
if ($this->buffer{($currentCharacter - $substringLength + $i
+ 1)} == $this->substring{$i}) {
// did all letters match?
if ($i == 0) {
$this->results[] = $currentCharacter -$substringLength;
$currentCharacter +=$this->getJumpLength
($this-buffer{$currentCharacter});
} else {
continue;
}
// mismatch, jump ahead ...
} else {
[ 302 ]
Download from Wow! eBook
www.WoweBook.com
Related documents
Nortel Networks V210 User's Manual
詳細データ
Nortel Networks V100 User's Manual
1 - Kozio
An Experimental Implementation of Equivalence Reasoning in the
pdf version - ShnfuCarver 1.0 documentation
Part I Getting Started with Arduino
Pragmatic Guide to Git
Zend Enterprise PHP Patterns
The iPad 2 Project Book: Stuff you can do with your iPad
O`Reilly - iPhone Game Development (2009)_www.megasoftz.com
File - Information Systems Department