Prints all occurrences of pat in txt
function search ( pat , txt ) { let M = pat . length ; let N = txt . length ; let TF = new Array ( M + 1 ) ; for ( let i = 0 ; i < M + 1 ; i ++ ) { TF [ i ] = new Array ( NO_OF_CHARS ) ; for ( let j = 0 ; j < NO_OF_CHARS ; j ++ ) TF [ i ] [ j ] = 0 ; } computeTF ( pat , M , TF ) ;