kernel-hacking-2024-linux-s.../lib
Thomas Graf df3fb93ad9 [LIB]: Knuth-Morris-Pratt textsearch algorithm
Implements a linear-time string-matching algorithm due to Knuth,
Morris, and Pratt [1]. Their algorithm avoids the explicit
computation of the transition function DELTA altogether. Its
matching time is O(n), for n being length(text), using just an
auxiliary function PI[1..m], for m being length(pattern),
precomputed from the pattern in time O(m). The array PI allows
the transition function DELTA to be computed efficiently
"on the fly" as needed. Roughly speaking, for any state
"q" = 0,1,...,m and any character "a" in SIGMA, the value
PI["q"] contains the information that is independent of "a" and
is needed to compute DELTA("q", "a") [2]. Since the array PI
has only m entries, whereas DELTA has O(m|SIGMA|) entries, we
save a factor of |SIGMA| in the preprocessing time by computing
PI rather than DELTA.
 
[1] Cormen, Leiserson, Rivest, Stein
    Introdcution to Algorithms, 2nd Edition, MIT Press
[2] See finite automation theory

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2005-06-23 20:58:37 -07:00
..
reed_solomon
zlib_deflate
zlib_inflate
bitmap.c
bust_spinlocks.c
cmdline.c
crc-ccitt.c
crc32.c
crc32defs.h
ctype.c
dec_and_lock.c
div64.c
dump_stack.c
errno.c
extable.c
find_next_bit.c
gen_crc32table.c
genalloc.c [PATCH] ia64 uncached alloc 2005-06-21 18:46:18 -07:00
halfmd4.c
idr.c [PATCH] coverity: idr_get_new_above_int() overrun fix 2005-06-21 18:46:12 -07:00
inflate.c
int_sqrt.c
iomap.c [PATCH] add Big Endian variants of ioread/iowrite 2005-04-16 15:25:54 -07:00
Kconfig [LIB]: Knuth-Morris-Pratt textsearch algorithm 2005-06-23 20:58:37 -07:00
Kconfig.debug [PATCH] uml: split CONFIG_FRAME_POINTER from DEBUG_INFO 2005-05-28 16:46:13 -07:00
kernel_lock.c [PATCH] smp_processor_id() cleanup 2005-06-21 18:46:13 -07:00
klist.c [PATCH] Don't reference NULL klist pointer in klist_remove(). 2005-06-20 15:15:19 -07:00
kobject.c [PATCH] Make kobject's name be const char * 2005-06-20 15:15:00 -07:00
kobject_uevent.c [PATCH] Make kobject's name be const char * 2005-06-20 15:15:00 -07:00
kref.c
libcrc32c.c
Makefile [LIB]: Knuth-Morris-Pratt textsearch algorithm 2005-06-23 20:58:37 -07:00
parser.c
prio_tree.c
radix-tree.c
rbtree.c
rwsem-spinlock.c [PATCH] use smp_mb/wmb/rmb where possible 2005-05-01 08:58:47 -07:00
rwsem.c [PATCH] use smp_mb/wmb/rmb where possible 2005-05-01 08:58:47 -07:00
sha1.c
smp_processor_id.c [PATCH] smp_processor_id() cleanup 2005-06-21 18:46:13 -07:00
sort.c [PATCH] fix lib/sort regression test 2005-05-05 16:36:50 -07:00
string.c [PATCH] documentation for strncpy() 2005-05-05 16:36:50 -07:00
textsearch.c [LIB]: Textsearch infrastructure. 2005-06-23 20:49:30 -07:00
ts_kmp.c [LIB]: Knuth-Morris-Pratt textsearch algorithm 2005-06-23 20:58:37 -07:00
vsprintf.c