{"id":1097,"date":"2023-02-10T10:03:03","date_gmt":"2023-02-10T02:03:03","guid":{"rendered":"http:\/\/www.algmain.com\/?page_id=1097"},"modified":"2023-02-11T11:50:31","modified_gmt":"2023-02-11T03:50:31","slug":"seach-length","status":"publish","type":"page","link":"http:\/\/www.algmain.com\/index.php\/algorithm-article\/hash-function\/seach-length\/","title":{"rendered":"\u67e5\u627e\u957f\u5ea6"},"content":{"rendered":"\n<p>\u5728\u5404\u79cd\u6570\u636e\u96c6\u5408\uff08\u5305\u62ec\u6570\u7ec4\u3001\u7ebf\u6027\u8868\u3001\u6811\u7b49\u6570\u636e\u7ed3\u6784\uff09\u4e2d\uff0c<strong>\u6570\u636e\u8bb0\u5f55<\/strong>\u5728\u96c6\u5408\u4e2d\u7684<strong>\u5b9e\u9645\u4f4d\u7f6e<\/strong>\u662f\u968f\u673a\u7684\uff0c\u548c\u6570\u636e\u8bb0\u5f55\u7684\u5173\u952e\u5b57\u4e4b\u95f4\u4e0d\u5b58\u5728\u786e\u5b9a\u7684\u5173\u7cfb\u3002\u56e0\u6b64\u5728\u6570\u636e\u96c6\u5408\u4e2d\u67e5\u627e\u6570\u636e\u8bb0\u5f55\u65f6\u9700\u8981\u8fdb\u884c\u4e00\u7cfb\u5217\u5173\u952e\u5b57\u7684\u6bd4\u8f83\u3002\u67e5\u627e\u7b97\u6cd5\u5927\u591a\u6570\u662f\u5efa\u7acb\u5728\u5173\u952e\u5b57\u6bd4\u8f83\u7684\u57fa\u7840\u4e0a\u3002<\/p>\n\n\n\n<p>\u5728\u987a\u5e8f\u67e5\u627e\u65f6\uff0c\u6bd4\u8f83\u7684\u7ed3\u679c\u4e3a&#8221;&nbsp;=&nbsp;&#8220;\u4e0e&#8221;&nbsp;\u2260&nbsp;&#8220;\u4e24\u79cd\u53ef\u80fd\u3002\u5728\u6298\u534a\u67e5\u627e\u3001\u4e8c\u53c9\u6392\u5e8f\u6811\u67e5\u627e\u548c\u6811\u67e5\u627e\u65f6\uff0c\u6bd4\u8f83\u7684\u7ed3\u679c\u4e3a&#8221;&nbsp;&lt;&nbsp;&#8220;\u3001&#8221;&nbsp;=&nbsp;&#8220;\u4e0e&#8221;&nbsp;&gt;&nbsp;&#8220;\u4e09\u79cd\u53ef\u80fd\u3002<strong>\u67e5\u627e\u7684\u6548\u7387\u4e3b\u8981\u51b3\u5b9a\u4e8e\u67e5\u627e\u8fc7\u7a0b\u4e2d\u6240\u8fdb\u884c\u7684\u6bd4\u8f83\u6b21\u6570\u548c\u65f6\u957f\u3002<\/strong>\u5728<strong>\u540c\u7b49\u5173\u952e\u5b57\u6a21\u5f0f<\/strong>\u4e0b\uff0c\u53c8\u4ee5\u6bd4\u8f83\u6b21\u6570\u4e3a\u6700\u4e3b\u8981\u7684\u56e0\u7d20\u3002<\/p>\n\n\n\n<p>\u4e3a\u786e\u5b9a\u6570\u636e\u8bb0\u5f55\u5728\u88ab\u67e5\u627e\u96c6\u5408\u4e2d\u7684\u5b9e\u9645\u4f4d\u7f6e\uff0c\u9700\u548c\u7ed9\u5b9a\u503c\u8fdb\u884c\u6bd4\u8f83\u7684\u5173\u952e\u5b57\u4e2a\u6570\uff08\u4e5f\u5373\u6bd4\u8f83\u6b21\u6570\uff09\u7684\u671f\u671b\u503c\u79f0\u4e3a\uff1a\u67e5\u627e\u7b97\u6cd5\u5728\u67e5\u627e\u6210\u529f\u65f6\u7684\u5e73\u5747\u67e5\u627e\u957f\u5ea6\uff08Average Search Length\uff09\u3002\u4e0b\u9762\u7b80\u5355\u8ba8\u8bba\u4e00\u4e0b\u5728\u542b\u6709\u4e2a\u6570\u636e\u8bb0\u5f55\u7684\u96c6\u5408\u4e2d\uff0c\u51e0\u79cd\u5e38\u89c1\u67e5\u627e\u7b97\u6cd5\u7684\u5e73\u5747\u67e5\u627e\u957f\u5ea6\u3002<\/p>\n\n\n\n<p>\u5728\u7b49\u6982\u7387\u7684\u60c5\u51b5\u4e0b\uff0c\u987a\u5e8f\u67e5\u627e\u7684\u5e73\u5747\u67e5\u627e\u957f\u5ea6\u4e3a\uff1a<\/p>\n\n\n\n<p>\\[ {ASL}_{ss} = \\frac{n+1}{2} \\]<\/p>\n\n\n\n<p>\u5bf9\u4e8e\u6298\u534a\u67e5\u627e\uff08\u8868\u8981\u6c42\u662f\u987a\u5e8f\u8868\uff09\uff0c\u5728\\(n\\)\u6bd4\u8f83\u5927\uff08\\(n&gt;50\\)\uff09\u7684\u65f6\u5019\uff0c\u53ef\u6709\u4ee5\u4e0b\u8fd1\u4f3c\u7ed3\u679c\uff1a<\/p>\n\n\n\n<p>\\[ {ASL}_{bs} = {\\log_2 (n + 1)} -1 \\]<\/p>\n\n\n\n<p>\u5728\u968f\u673a\u60c5\u51b5\u4e0b\uff08\u4e8c\u53c9\u6811\u67e5\u627e\u53ef\u80fd\u9000\u5316\u4e3a\u987a\u5e8f\u67e5\u627e\uff09\uff0c\u5bf9\u4e8e\u4e8c\u53c9\u6811\uff0c\u5176\u5e73\u5747\u67e5\u627e\u957f\u5ea6\u4e3a\uff1a<\/p>\n\n\n\n<p>\\[ {ASL}_{b} = 1 + 4{\\log n} \\]<\/p>\n\n\n\n<p>\u5728\u5e73\u8861\u4e8c\u53c9\u6811\u4e0a\u8fdb\u884c\u67e5\u627e\uff0c\u5176\u5e73\u5747\u67e5\u627e\u957f\u5ea6\u4e3a\uff1a<\/p>\n\n\n\n<p>\\[ {ASL}_{bb} = {{\\log_\\phi} [ {\\sqrt 5} (n + 1) ]} &#8211; 2 \\]<\/p>\n\n\n\n<p>\u5176\u4e2d\uff0c\\(\\phi = \\frac {1+ \\sqrt 5}{2}\\)\u3002<\/p>\n\n\n\n<p>\u5bf9\u4e8e\u4e00\u9897\u9636\u7684\u6811\uff0c\u4ece\u6839\u8282\u70b9\u5230\u5173\u952e\u5b57\u6240\u5728\u8282\u70b9\u7684\u8def\u5f84\u4e0a\u6d89\u53ca\u7684\u8282\u70b9\u6570\u53ef\u4ee5\u8bf4\u662f\u5e73\u5747\u67e5\u627e\u957f\u5ea6\u7684\u4e0a\u9650\uff1a<\/p>\n\n\n\n<p>\\[ {ASL}_{B^-} \\le {\\log_{\\frac{m}{2}} \\frac{n+1}{2}} + 1 \\]<\/p>\n\n\n\n<p>\u603b\u7684\u6765\u8bf4\uff0c\u8fd9\u4e9b\u67e5\u627e\u7b97\u6cd5\u7684\u6548\u7387\u90fd\u5c06\u968f\u7740\u6570\u636e\u8bb0\u5f55\u6570\\(n\\)\u7684\u589e\u957f\u800c\u4e0b\u964d\u3002\u4ec5\u4ec5\u662f\u6709\u7684\u4e0b\u964d\u5f97\u6bd4\u8f83\u5feb\uff08\u65f6\u95f4\u590d\u6742\u5ea6\u4e3a\\(O(n)\\)&nbsp;\uff0c\u6709\u7684\u4e0b\u964d\u5f97\u6bd4\u8f83\u6162\uff08\u65f6\u95f4\u590d\u6742\u5ea6\u662f&nbsp;\\(O[\\log(n)]\\)&nbsp;\uff09\u800c\u5df2\u3002<\/p>\n\n\n\n<p>\u8fd9\u4e9b\u67e5\u627e\u7b97\u6cd5\u7684\u5e73\u5747\u67e5\u627e\u957f\u5ea6\u662f\u5728\u4e00\u79cd\u6bd4\u8f83\u7406\u60f3\u7684\u60c5\u51b5\u4e0b\u83b7\u5f97\u7684\u3002\u5728\u5b9e\u9645\u5e94\u7528\u5f53\u4e2d\uff0c\u5bf9<strong>\u6570\u636e\u7ed3\u6784<\/strong>\u4e2d\u6570\u636e\u8bb0\u5f55\u7684\u9891\u7e41\u589e\u52a0\u548c\u5220\u9664\u5c06\u4e0d\u65ad\u5730\u6539\u53d8\u7740\u539f\u6709\u7684\u6570\u636e\u7ed3\u6784\u3002\u8fd9\u4e9b\u64cd\u4f5c\u5c06\u53ef\u80fd\u5bfc\u81f4\u67d0\u4e9b\u6570\u636e\u7ed3\u6784\u9000\u5316\u4e3a\u94fe\u8868\u7ed3\u6784\uff0c\u90a3\u4e48\u5176\u6027\u80fd\u5fc5\u7136\u5c06\u4e0b\u964d\u3002\u4e3a\u4e86\u907f\u514d\u51fa\u73b0\u8fd9\u79cd\u60c5\u51b5\u800c\u91c7\u53d6\u7684\u8c03\u6574\u63aa\u65bd\uff0c\u53c8\u4e0d\u53ef\u907f\u514d\u7684\u589e\u52a0\u4e86\u7a0b\u5e8f\u7684\u590d\u6742\u7a0b\u5ea6\u4ee5\u53ca\u64cd\u4f5c\u7684\u989d\u5916\u65f6\u95f4\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u62d3\u5c55\u9605\u8bfb<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>CSDN : <a href=\"https:\/\/blog.csdn.net\/wuprogrammer\/article\/details\/105425170\" target=\"_blank\" rel=\"noreferrer noopener\">\u67e5\u627e\u7b97\u6cd5<\/a><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5404\u79cd\u6570\u636e\u96c6\u5408\uff08\u5305\u62ec\u6570\u7ec4\u3001\u7ebf\u6027\u8868\u3001\u6811\u7b49\u6570\u636e\u7ed3\u6784\uff09\u4e2d\uff0c\u6570\u636e\u8bb0\u5f55\u5728\u96c6\u5408\u4e2d\u7684\u5b9e\u9645\u4f4d\u7f6e\u662f\u968f\u673a\u7684\uff0c\u548c\u6570\u636e\u8bb0\u5f55\u7684\u5173\u952e\u5b57\u4e4b\u95f4 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1021,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1097","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/pages\/1097"}],"collection":[{"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/comments?post=1097"}],"version-history":[{"count":10,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/pages\/1097\/revisions"}],"predecessor-version":[{"id":1300,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/pages\/1097\/revisions\/1300"}],"up":[{"embeddable":true,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/pages\/1021"}],"wp:attachment":[{"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/media?parent=1097"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}