As soon as we get a mismatch in trying to match the word


A different approach to fast text searching is to step through the text in skips equal to the word length. As soon as we get a mismatch in trying to match the word sought we skip to the start of the next word. To do this it is necessary to build the "skip-to-the-next-word" links into the text. For example.

11THIS IS A 16 SENTENCE TO BE 6 SKIP 0 SEARCHED

A "0" is used to indicate an end of line. In conducting this preprocessing it is often prudent to skip over small words (which we are usually not interested in searching for). When words of three characters or less are ignored it is only necessary to examine about 10-20% of the text characters in conducting a search. The performance of this new algorithm will therefore frequently compare very favorably with the algorithm we have just developed.

Design the necessary preprocessing and searching algorithms.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: As soon as we get a mismatch in trying to match the word
Reference No:- TGS01735342

Expected delivery within 24 Hours