1. An apparatus implementing a layered memory architecture and capable of string matching using deterministic finite automata, said apparatus comprising: a memory necessary for said string matching, wherein said memory comprises at least three memories including a first memory means, a second memory means, and a third memory means, wherein said first memory means is faster and smaller than said second memory means and said second memory means is faster and smaller than said third memory means; and a partitioning mechanism for strategically partitioning said memory between said first, second, and third memory means, wherein said partitioning mechanism implements a data structure that organizes, associates, and stores data in a manner that maximizes efficiency, capacity, and speed of each memory means.