Skip to content

Instantly share code, notes, and snippets.

View ashutoshsharmagit's full-sized avatar

ashutoshsharmagit

View GitHub Profile
@ashutoshsharmagit
ashutoshsharmagit / BoyerMoore.php
Created April 6, 2016 15:52 — forked from nticaric/BoyerMoore.php
Boyer–Moore algorithm implementation in PHP
<?php
/**
* Returns the index of the first occurrence of the
* specified substring. If it's not found return -1.
*
* @param text The string to be scanned
* @param pattern The target string to search
* @return The start index of the substring
*/