📄 merge.html
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD W3 HTML 2.0//EN">
<HTML lang="en-US">
<HEAD>
<TITLE>merge</TITLE>
<META name="description"
content="Definition of merge,
possibly with links to more information and implementations.">
<META name="keywords" content="merge">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H1>merge</H1>
<P>
(definition)
<P>
<strong>Definition:</strong>
Combine two or more sorted sequences of data into a single sorted sequence.
<P><strong>See also</strong>
<a href="nonitermerge.html" tppabs="http://hissa.nist.gov/dads/HTML/nonitermerge.html"><em>noniterative merge</em></a>, <a href="simplemerge.html" tppabs="http://hissa.nist.gov/dads/HTML/simplemerge.html"><em>simple merge</em></a>, <a href="idealmerge.html" tppabs="http://hissa.nist.gov/dads/HTML/idealmerge.html"><em>ideal merge</em></a>, <a href="twowaymrgsrt.html" tppabs="http://hissa.nist.gov/dads/HTML/twowaymrgsrt.html"><em>two-way merge sort</em></a>, <a href="threewaymsrt.html" tppabs="http://hissa.nist.gov/dads/HTML/threewaymsrt.html"><em>three-way merge sort</em></a>, <a href="kwaymergsort.html" tppabs="http://hissa.nist.gov/dads/HTML/kwaymergsort.html"><em>k-way merge sort</em></a>, <a href="balancmrgsrt.html" tppabs="http://hissa.nist.gov/dads/HTML/balancmrgsrt.html"><em>balanced merge sort</em></a>, <a href="nonbalncmsrt.html" tppabs="http://hissa.nist.gov/dads/HTML/nonbalncmsrt.html"><em>nonbalanced merge sort</em></a>.
<P><em>Note:
Formally the input is two sequences, A={a<sub>1</sub>, ..., a<sub>n</sub>} and B={b<sub>1</sub>, ..., b<sub>m</sub>}, each sorted according to some <a href="totalorder.html" tppabs="http://hissa.nist.gov/dads/HTML/totalorder.html"><em>total order</em></a>, <=. The output is a single sequence, merge(A,B), which is a sorted permutation of {a<sub>1</sub>, ..., a<sub>n</sub>, b<sub>1</sub>, ..., b<sub>m</sub>}. <P> The method defines merge(A, B) as (1) A if B is empty, (2) B if A is empty, (3) {a<sub>1</sub>}.merge({a<sub>2</sub>, ..., a<sub>n</sub>}, B) if a<sub>1</sub> <= b<sub>1</sub>, and (4) {b<sub>1</sub>}.merge(A, {b<sub>2</sub>, ..., b<sub>m</sub>}) otherwise. Here are symbol "." stands for concatenation, for example, {a<sub>1</sub>, ..., a<sub>n</sub>}.{b<sub>1</sub>, ..., b<sub>m</sub>} = {a<sub>1</sub>, ..., a<sub>n</sub>, b<sub>1</sub>, ..., b<sub>m</sub>}. <P> Formalization by Mustafa Ege <ege@eti.cc.hun.edu.tr>.</em>
<P>Author: <a href="terms.html#authorASK" tppabs="http://hissa.nist.gov/dads/terms.html#authorASK">ASK</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 Tue Jun 8 12:08:39 1999.<BR>
HTML page formatted Wed Dec 22 09:35:50 1999.
<P>
This page's URL is
<A href="merge.html" tppabs="http://hissa.nist.gov/dads/HTML/merge.html">http://hissa.nist.gov/dads/HTML/merge.html</A>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -