摘要 |
<p>The invention provides a method and apparatus for finding a longest and closest matching string in a history buffer (162a) prior to a current string (163). A search algorithm in accordance with the invention first tries to find the longest matching old string (MOS) in the history buffer (162a) as its major task, and in a case where two MOS's are found to have the same longest matching length, the search algorithm tries to select the MOS closest to the current position as its minor task. Linked lists (182.xn) are constructed as searching progresses to speed the search process. The linked lists define a fast-path array which points to all locations within the history buffer (162a) containing a specified code sequence. Pointers to locations outside the history buffer (182.4f) are optionally removed and their space returned to memory free space.</p> |