📄 interpolsrch.html
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD W3 HTML 2.0//EN">
<HTML lang="en-US">
<HEAD>
<TITLE>interpolation search</TITLE>
<META name="description"
content="Definition of interpolation search,
possibly with links to more information and implementations.">
<META name="keywords" content="interpolation search">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H1>interpolation search</H1>
<P>
(algorithm)
<P>
<strong>Definition:</strong>
Searching a <a href="sortedarray.html" tppabs="http://hissa.nist.gov/dads/HTML/sortedarray.html"><em>sorted array</em></a> by estimating the next position to check based on the value of search <a href="key.html" tppabs="http://hissa.nist.gov/dads/HTML/key.html"><em>key</em></a> and the values of the end points.
<P><em>Note:
You probably use this when looking something up in the telephone book or dictionary. For instance, "cold fusion" is probably near front, so you open maybe 1/4 of the way in. What you find there helps you decide whether to jump many pages or just a few. Compare this with a <a href="linearsrch.html" tppabs="http://hissa.nist.gov/dads/HTML/linearsrch.html"><em>linear search</em></a>, where you check each entry in order from the beginning, or a <a href="binarysrch.html" tppabs="http://hissa.nist.gov/dads/HTML/binarysrch.html"><em>binary search</em></a>, where you always divide the search interval exactly in half. Unless the data is very uniform, there are millions of records, or comparisons are very time-consuming, a binary search is probably no slower since interpolation is usually time-consuming on a computer and a binary search only takes log(n) comparisons anyway.</em>
<P>Author: <a href="terms.html#authorPEB" tppabs="http://hissa.nist.gov/dads/terms.html#authorPEB">PEB</a>
<H2>Implementation</H2>
<A HREF="javascript:if(confirm('http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.auto.tuwien.ac.at/%7Eblieb/woop/inter.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.auto.tuwien.ac.at/%7Eblieb/woop/inter.html'" tppabs="http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.auto.tuwien.ac.at/%7Eblieb/woop/inter.html">worst case analysis (dialect of Ada)</A> <A HREF="javascript:if(confirm('http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.dcc.uchile.cl/%7Eoalonso/handbook/algs/3/322.srch.p.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.dcc.uchile.cl/%7Eoalonso/handbook/algs/3/322.srch.p.html'" tppabs="http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.dcc.uchile.cl/%7Eoalonso/handbook/algs/3/322.srch.p.html">(Pascal)</A>
<hr>
Go to the
<A HREF="terms.html" tppabs="http://hissa.nist.gov/dads/terms.html">Algorithms, Data Structures, and Problems</A>
home page.
<hr>
If you have suggestions, corrections, or comments, please get in touch
with
<a href="javascript:if(confirm('http://hissa.nist.gov/~black/black.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://hissa.nist.gov/~black/black.html'" tppabs="http://hissa.nist.gov/~black/black.html">Paul E. Black</a>
(<a href="mailto:paul.black@nist.gov">paul.black@nist.gov</a>).
<p>
Entry modified Wed May 5 14:24:24 1999.<BR>
HTML page formatted Wed Dec 22 09:35:36 1999.
<P>
This page's URL is
<A href="interpolsrch.html" tppabs="http://hissa.nist.gov/dads/HTML/interpolsrch.html">http://hissa.nist.gov/dads/HTML/interpolsrch.html</A>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -