全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Pattern, occurrence?

又称: pattern (text search) · occurrence

Definition 29.1 High School Computer Science · 第 29 章 — Searching in Text

In text search, the pattern is the string looked for, of length mm, in a text of length nn. An occurrence of the pattern is a position ii of the text with text[i:i + m] == p. Placing the pattern under the text from position ii is called an alignment; there are n−m+1n - m + 1 of them.

The naive search for plan. Each row is one alignment; the boxed letter is the one compared, the grey letters are never looked at. In ordinary text most alignments fail at the first or second letter, so the search makes a little more than one comparison per position.
The naive search for plan. Each row is one alignment; the boxed letter is the one compared, the grey letters are never looked at. In ordinary text most alignments fail at the first or second letter, so the search makes a little more than one comparison per position.
在原文中阅读 →