{"id":484444,"date":"2026-06-21T19:12:28","date_gmt":"2026-06-21T19:12:28","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=484444"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=484444","title":{"rendered":"\u0410\u0443\u0434\u0438\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432: \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Boyer-Moore \u0441 190K \u0437\u0432\u0451\u0437\u0434 \u043d\u0430 GitHub \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c brute-force"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 2015 \u0433\u043e\u0434\u0443 \u0433\u0440\u0443\u043f\u043f\u0430 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 (<a href=\"https:\/\/doi.org\/10.1101\/031500\" rel=\"noopener noreferrer nofollow\">Flouri et al.<\/a>) \u0440\u0435\u0448\u0438\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e <a href=\"https:\/\/pubmed.ncbi.nlm.nih.gov\/7166760\/\" rel=\"noopener noreferrer nofollow\">\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0413\u043e\u0442\u043e\u0445\u0430<\/a> (1982) \u0434\u043b\u044f \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439. \u0418\u0437 10 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0442\u043e\u043b\u044c\u043a\u043e 2 \u0434\u0430\u0432\u0430\u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. 8 \u0438\u0437 31 \u0443\u0447\u0435\u0431\u043d\u044b\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b\u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>\u042f \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0442\u0438\u043f\u0438\u0447\u043d\u043e \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u041d\u0430\u0447\u0430\u043b \u0441 <a href=\"https:\/\/dl.acm.org\/doi\/10.1145\/359842.359859\" rel=\"noopener noreferrer nofollow\">Boyer-Moore<\/a> (1977), \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<h4>\u041c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f<\/h4>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u043b \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043b\u044e\u0431\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0440\u043e\u0442\u0438\u0432 brute-force \u044d\u0442\u0430\u043b\u043e\u043d\u0430:<\/p>\n<ul>\n<li>\n<p>35 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432: \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f, \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, pattern == text<\/p>\n<\/li>\n<li>\n<p>Property-based \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b (8000+ \u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e): \u043f\u043e\u043b\u043d\u043e\u0442\u0430 (\u0432\u0441\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u043d\u0430\u0439\u0434\u0435\u043d\u044b), \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c (\u043d\u0435\u0442 \u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439), \u043f\u043e\u0440\u044f\u0434\u043e\u043a, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u043d\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f: \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439\/\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0430\u043b\u0444\u0430\u0432\u0438\u0442, \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u0434\u043b\u0438\u043d\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b<\/p>\n<\/li>\n<\/ul>\n<h4>\u041d\u0430\u0445\u043e\u0434\u043a\u0430 1: TheAlgorithms\/Python (190K+ \u0437\u0432\u0451\u0437\u0434)<\/h4>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043d\u0430 GitHub. \u0424\u0430\u0439\u043b <code>strings\/boyer_moore_search.py<\/code>.<\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 <code>bad_character_heuristic()<\/code> \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u0439. \u041d\u043e \u0441\u0434\u0432\u0438\u0433 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0446\u0438\u043a\u043b\u0430 <code>for<\/code>:<\/p>\n<pre><code class=\"python\">for i in range(self.textLen - self.patLen + 1):    mismatch_index = self.mismatch_in_text(i)    if mismatch_index == -1:        positions.append(i)    else:        match_index = self.match_in_pattern(self.text[mismatch_index])        i = (mismatch_index - match_index)  # \u043c\u0451\u0440\u0442\u0432\u044b\u0439 \u043a\u043e\u0434<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412 Python \u043f\u0435\u0440\u0435\u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>for<\/code>-\u0446\u0438\u043a\u043b\u0430 \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e. <code>for i in range(N)<\/code> \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0435\u0440\u0451\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 <code>range()<\/code>, \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u044f \u043b\u044e\u0431\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f <code>i<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0435\u043b\u0430 \u0446\u0438\u043a\u043b\u0430.<\/p>\n<p>\u042f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439:<\/p>\n<pre><code>\u0422\u0435\u043a\u0441\u0442: 32 \u0441\u0438\u043c\u0432\u043e\u043b\u0430, \u041f\u0430\u0442\u0442\u0435\u0440\u043d: 4 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u0418\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e: 29 (= brute-force)\u0420\u0430\u0431\u043e\u0447\u0438\u0439 Boyer-Moore: ~8 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432\u044b\u0434\u0430\u0451\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442. \u041d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0437\u0430 O(nm) \u0432\u043c\u0435\u0441\u0442\u043e O(n\/m). \u041a\u0430\u0436\u0434\u044b\u0439, \u043a\u0442\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u044d\u0442\u043e\u0442 \u043a\u043e\u0434, \u0434\u0443\u043c\u0430\u0435\u0442 \u0447\u0442\u043e \u0443 \u043d\u0435\u0433\u043e Boyer-Moore, \u0430 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0438\u043c\u0435\u0435\u0442 \u043d\u0430\u0438\u0432\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0441 \u043b\u0438\u0448\u043d\u0438\u043c\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<p>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0435: \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c <code>for<\/code> \u043d\u0430 <code>while<\/code>.<\/p>\n<h4>\u041d\u0430\u0445\u043e\u0434\u043a\u0430 2: \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u043f\u0440\u0438 pattern == text<\/h4>\n<p>\u0422\u0438\u043f\u0438\u0447\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u043d\u043e\u0433\u043e Boyer-Moore (\u0441 \u043e\u0431\u043e\u0438\u043c\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438: bad character + good suffix) \u0437\u0430\u0432\u0438\u0441\u0430\u0435\u0442 \u043d\u0430 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0445\u043e\u0434\u0435 <code>search(\"abc\", \"abc\")<\/code>.<\/p>\n<p>\u041f\u0440\u0438\u0447\u0438\u043d\u0430: \u043f\u0440\u0438 \u043f\u043e\u043b\u043d\u043e\u043c \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0438\u043d\u0434\u0435\u043a\u0441 <code>i<\/code> \u0434\u0435\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 <code>m<\/code> \u043f\u043e\u0437\u0438\u0446\u0438\u0439 (\u0441 <code>m-1<\/code> \u0434\u043e <code>-1<\/code>). \u0417\u0430\u0442\u0435\u043c <code>good_suffix[0]<\/code> \u0441\u0434\u0432\u0438\u0433\u0430\u0435\u0442 <code>i<\/code> \u0440\u043e\u0432\u043d\u043e \u043d\u0430 <code>m<\/code> \u043d\u0430\u0437\u0430\u0434. <code>i<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e. \u0426\u0438\u043a\u043b \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u0435\u043d.<\/p>\n<h4>\u041d\u0430\u0445\u043e\u0434\u043a\u0430 3: \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f 1977 \u0433\u043e\u0434\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0443<\/h4>\n<p>Boyer \u0438 Moore \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432 1977 \u0433\u043e\u0434\u0443, \u043d\u043e \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b good suffix (delta2). \u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u0430\u043b \u0412\u043e\u0439\u0446\u0435\u0445 \u0420\u0438\u0442\u0435\u0440 (<a href=\"https:\/\/epubs.siam.org\/doi\/10.1137\/0209037\" rel=\"noopener noreferrer nofollow\">Rytter<\/a>) \u0432 1980 \u0433\u043e\u0434\u0443, \u0447\u0435\u0440\u0435\u0437 3 \u0433\u043e\u0434\u0430.<\/p>\n<p>\u042d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0442\u044c\u0441\u044f. \u0412 2019 \u0433\u043e\u0434\u0443 Microsoft \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u043b\u0430 \u0431\u0430\u0433\u0438 \u0432 <code>std::boyer_moore_searcher<\/code> (C++17 STL), \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u043c Rytter correction.<\/p>\n<h4>\u041c\u0430\u0441\u0448\u0442\u0430\u0431 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b<\/h4>\n<p>\u042d\u0442\u043e \u043d\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f. \u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043a\u043e\u043f\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u0430\u043c\u0438, \u043b\u0435\u043a\u0446\u0438\u044f\u043c\u0438 \u0438 GitHub-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u043c\u0438 \u0431\u0435\u0437 \u0432\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u0434\u0435\u0441\u044f\u0442\u0438\u043b\u0435\u0442\u0438\u044f\u043c\u0438.<\/p>\n<p>\u042f \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437 35 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0432 6 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u0445 (\u0431\u0438\u043e\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u043a\u0430, \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u0433\u0440\u0430\u0444\u044b, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438, \u0441\u0442\u0440\u043e\u043a\u0438, \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u044f) \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u0443\u0434\u0438\u0442\u0430. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0446\u0435\u043b\u044c: BLAST (1990), \u0441\u0430\u043c\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0431\u0438\u043e\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u043a\u0438. \u0424\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u0443\u0434\u0438\u0442\u0430 \u0435\u0433\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u0438 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 35 \u043b\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<h4>\u041a\u043e\u0434<\/h4>\n<p>\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0438 \u0432\u0441\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b: <a href=\"https:\/\/github.com\/devladpopov\/algorithm-autopsy\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/devladpopov\/algorithm-autopsy<\/a><\/p>\n<p>Issue \u0432 TheAlgorithms\/Python: <a href=\"https:\/\/github.com\/TheAlgorithms\/Python\/issues\/14844\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/TheAlgorithms\/Python\/issues\/14844<\/a><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0437\u043d\u0430\u0435\u0442\u0435 \u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0431\u0430\u0433\u0430\u0445 \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u0445, \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c.<\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1050180\/\">https:\/\/habr.com\/ru\/articles\/1050180\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412 2015 \u0433\u043e\u0434\u0443 \u0433\u0440\u0443\u043f\u043f\u0430 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 (Flouri et al.) \u0440\u0435\u0448\u0438\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0413\u043e\u0442\u043e\u0445\u0430 (1982) \u0434\u043b\u044f \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439. \u0418\u0437 10 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0442\u043e\u043b\u044c\u043a\u043e 2 \u0434\u0430\u0432\u0430\u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. 8 \u0438\u0437 31 \u0443\u0447\u0435\u0431\u043d\u044b\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b\u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443.\u042f \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0442\u0438\u043f\u0438\u0447\u043d\u043e \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u041d\u0430\u0447\u0430\u043b \u0441 Boyer-Moore (1977), \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438.\u041c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f\u041d\u0430\u043f\u0438\u0441\u0430\u043b \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043b\u044e\u0431\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0440\u043e\u0442\u0438\u0432 brute-force \u044d\u0442\u0430\u043b\u043e\u043d\u0430:35 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432: \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f, \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, pattern == textProperty-based \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b (8000+ \u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e): \u043f\u043e\u043b\u043d\u043e\u0442\u0430 (\u0432\u0441\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u043d\u0430\u0439\u0434\u0435\u043d\u044b), \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c (\u043d\u0435\u0442 \u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439), \u043f\u043e\u0440\u044f\u0434\u043e\u043a, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u0420\u0430\u0437\u043d\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f: \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439\/\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0430\u043b\u0444\u0430\u0432\u0438\u0442, \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u0434\u043b\u0438\u043d\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b\u041d\u0430\u0445\u043e\u0434\u043a\u0430 1: TheAlgorithms\/Python (190K+ \u0437\u0432\u0451\u0437\u0434)\u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043d\u0430 GitHub. \u0424\u0430\u0439\u043b strings\/boyer_moore_search.py.\u041c\u0435\u0442\u043e\u0434 bad_character_heuristic() \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u0439. \u041d\u043e \u0441\u0434\u0432\u0438\u0433 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0446\u0438\u043a\u043b\u0430 for:for i in range(self.textLen &#8212; self.patLen + 1):    mismatch_index = self.mismatch_in_text(i)    if mismatch_index == -1:        positions.append(i)    else:        match_index = self.match_in_pattern(self.text[mismatch_index])        i = (mismatch_index &#8212; match_index)  # \u043c\u0451\u0440\u0442\u0432\u044b\u0439 \u043a\u043e\u0434\u0412 Python \u043f\u0435\u0440\u0435\u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 for-\u0446\u0438\u043a\u043b\u0430 \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e. for i in range(N) \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0435\u0440\u0451\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 range(), \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u044f \u043b\u044e\u0431\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f i \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0435\u043b\u0430 \u0446\u0438\u043a\u043b\u0430.\u042f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439:\u0422\u0435\u043a\u0441\u0442: 32 \u0441\u0438\u043c\u0432\u043e\u043b\u0430, \u041f\u0430\u0442\u0442\u0435\u0440\u043d: 4 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u0418\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e: 29 (= brute-force)\u0420\u0430\u0431\u043e\u0447\u0438\u0439 Boyer-Moore: ~8 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432\u044b\u0434\u0430\u0451\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442. \u041d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0437\u0430 O(nm) \u0432\u043c\u0435\u0441\u0442\u043e O(n\/m). \u041a\u0430\u0436\u0434\u044b\u0439, \u043a\u0442\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u044d\u0442\u043e\u0442 \u043a\u043e\u0434, \u0434\u0443\u043c\u0430\u0435\u0442 \u0447\u0442\u043e \u0443 \u043d\u0435\u0433\u043e Boyer-Moore, \u0430 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0438\u043c\u0435\u0435\u0442 \u043d\u0430\u0438\u0432\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0441 \u043b\u0438\u0448\u043d\u0438\u043c\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u043c\u0438.\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0435: \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c for \u043d\u0430 while.\u041d\u0430\u0445\u043e\u0434\u043a\u0430 2: \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u043f\u0440\u0438 pattern == text\u0422\u0438\u043f\u0438\u0447\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u043d\u043e\u0433\u043e Boyer-Moore (\u0441 \u043e\u0431\u043e\u0438\u043c\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438: bad character + good suffix) \u0437\u0430\u0432\u0438\u0441\u0430\u0435\u0442 \u043d\u0430 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0445\u043e\u0434\u0435 search(&#171;abc&#187;, &#171;abc&#187;).\u041f\u0440\u0438\u0447\u0438\u043d\u0430: \u043f\u0440\u0438 \u043f\u043e\u043b\u043d\u043e\u043c \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0438\u043d\u0434\u0435\u043a\u0441 i \u0434\u0435\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 m \u043f\u043e\u0437\u0438\u0446\u0438\u0439 (\u0441 m-1 \u0434\u043e -1). \u0417\u0430\u0442\u0435\u043c good_suffix[0] \u0441\u0434\u0432\u0438\u0433\u0430\u0435\u0442 i \u0440\u043e\u0432\u043d\u043e \u043d\u0430 m \u043d\u0430\u0437\u0430\u0434. i \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e. \u0426\u0438\u043a\u043b \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u0435\u043d.\u041d\u0430\u0445\u043e\u0434\u043a\u0430 3: \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f 1977 \u0433\u043e\u0434\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0443Boyer \u0438 Moore \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432 1977 \u0433\u043e\u0434\u0443, \u043d\u043e \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b good suffix (delta2). \u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u0430\u043b \u0412\u043e\u0439\u0446\u0435\u0445 \u0420\u0438\u0442\u0435\u0440 (Rytter) \u0432 1980 \u0433\u043e\u0434\u0443, \u0447\u0435\u0440\u0435\u0437 3 \u0433\u043e\u0434\u0430.\u042d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0442\u044c\u0441\u044f. \u0412 2019 \u0433\u043e\u0434\u0443 Microsoft \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u043b\u0430 \u0431\u0430\u0433\u0438 \u0432 std::boyer_moore_searcher (C++17 STL), \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u043c Rytter correction.\u041c\u0430\u0441\u0448\u0442\u0430\u0431 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b\u042d\u0442\u043e \u043d\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f. \u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043a\u043e\u043f\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u0430\u043c\u0438, \u043b\u0435\u043a\u0446\u0438\u044f\u043c\u0438 \u0438 GitHub-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u043c\u0438 \u0431\u0435\u0437 \u0432\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u0434\u0435\u0441\u044f\u0442\u0438\u043b\u0435\u0442\u0438\u044f\u043c\u0438.\u042f \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437 35 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0432 6 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u0445 (\u0431\u0438\u043e\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u043a\u0430, \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u0433\u0440\u0430\u0444\u044b, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438, \u0441\u0442\u0440\u043e\u043a\u0438, \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u044f) \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u0443\u0434\u0438\u0442\u0430. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0446\u0435\u043b\u044c: BLAST (1990), \u0441\u0430\u043c\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0431\u0438\u043e\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u043a\u0438. \u0424\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u0443\u0434\u0438\u0442\u0430 \u0435\u0433\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u0438 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 35 \u043b\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.\u041a\u043e\u0434\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0438 \u0432\u0441\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b: https:\/\/github.com\/devladpopov\/algorithm-autopsyIssue \u0432 TheAlgorithms\/Python: https:\/\/github.com\/TheAlgorithms\/Python\/issues\/14844\u0415\u0441\u043b\u0438 \u0437\u043d\u0430\u0435\u0442\u0435 \u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0431\u0430\u0433\u0430\u0445 \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u0445, \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c.\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 https:\/\/habr.com\/ru\/articles\/1050180\/<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-484444","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/484444","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=484444"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/484444\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=484444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=484444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=484444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}