<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://algorist.com/algowiki_v2/index.php?action=history&amp;feed=atom&amp;title=TADM2E_4.14</id>
		<title>TADM2E 4.14 - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://algorist.com/algowiki_v2/index.php?action=history&amp;feed=atom&amp;title=TADM2E_4.14"/>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php?title=TADM2E_4.14&amp;action=history"/>
		<updated>2026-04-30T23:59:57Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.28.0</generator>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php?title=TADM2E_4.14&amp;diff=139&amp;oldid=prev</id>
		<title>Algowikiadmin: Recovering wiki</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php?title=TADM2E_4.14&amp;diff=139&amp;oldid=prev"/>
				<updated>2014-09-11T18:22:48Z</updated>
		
		<summary type="html">&lt;p&gt;Recovering wiki&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 18:22, 11 September 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot; &gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The elementary algorithm compares the heads of each of&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The elementary algorithm compares the heads of each of&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/del&gt;math&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/del&gt;k&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/del&gt;/math&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt; &lt;/del&gt;sorted lists to find the minimum element, puts this in the sorted&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/ins&gt;math&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/ins&gt;k&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/ins&gt;/math&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt; &lt;/ins&gt;sorted lists to find the minimum element, puts this in the sorted&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;list and repeats.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;list and repeats.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The total time is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/del&gt;math&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/del&gt;O(k n)&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/del&gt;/math&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The total time is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/ins&gt;math&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/ins&gt;O(k n)&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/ins&gt;/math&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Suppose instead that we build a heap on the head elements of each&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Suppose instead that we build a heap on the head elements of each&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;of the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/del&gt;math&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/del&gt;k&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/del&gt;/math&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt; &lt;/del&gt;lists, with each element labeled as to which list it is from.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;of the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/ins&gt;math&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/ins&gt;k&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/ins&gt;/math&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt; &lt;/ins&gt;lists, with each element labeled as to which list it is from.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The minimum element can be found and deleted in &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/del&gt;math&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/del&gt;O(\log k)&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/del&gt;/math&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt; &lt;/del&gt;time.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The minimum element can be found and deleted in &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/ins&gt;math&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/ins&gt;O(\log k)&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/ins&gt;/math&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt; &lt;/ins&gt;time.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Further, we can insert the new head of this list in the heap in &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/del&gt;math&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/del&gt;O(\log k)&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/del&gt;/math&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Further, we can insert the new head of this list in the heap in &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/ins&gt;math&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/ins&gt;O(\log k)&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/ins&gt;/math&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;time.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;time.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An alternate &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/del&gt;math&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/del&gt;O(n \log k)&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/del&gt;/math&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt; &lt;/del&gt;approach would be to&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An alternate &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/ins&gt;math&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/ins&gt;O(n \log k)&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/ins&gt;/math&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt; &lt;/ins&gt;approach would be to&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;merge the lists from as in mergesort,&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;merge the lists from as in mergesort,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;using a binary tree on &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/del&gt;math&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/del&gt;k&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/del&gt;/math&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt; &lt;/del&gt;leaves (one for each list).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;using a binary tree on &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/ins&gt;math&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/ins&gt;k&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/ins&gt;/math&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt; &lt;/ins&gt;leaves (one for each list).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;problem&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;problem&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Algowikiadmin</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php?title=TADM2E_4.14&amp;diff=44&amp;oldid=prev</id>
		<title>Algowikiadmin: Recovering wiki</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php?title=TADM2E_4.14&amp;diff=44&amp;oldid=prev"/>
				<updated>2014-09-11T18:13:30Z</updated>
		
		<summary type="html">&lt;p&gt;Recovering wiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Scan through all k lists in any order and use the stream of elements to build a heap of k elements. Since bubble_down works in O(logk) for a heap of k elements, we thus solve the problem in O(nlogk).&lt;br /&gt;
&lt;br /&gt;
The elementary algorithm compares the heads of each of&lt;br /&gt;
the &amp;amp;lt;math&amp;amp;gt;k&amp;amp;lt;/math&amp;amp;gt; sorted lists to find the minimum element, puts this in the sorted&lt;br /&gt;
list and repeats.&lt;br /&gt;
The total time is &amp;amp;lt;math&amp;amp;gt;O(k n)&amp;amp;lt;/math&amp;amp;gt;.&lt;br /&gt;
Suppose instead that we build a heap on the head elements of each&lt;br /&gt;
of the &amp;amp;lt;math&amp;amp;gt;k&amp;amp;lt;/math&amp;amp;gt; lists, with each element labeled as to which list it is from.&lt;br /&gt;
The minimum element can be found and deleted in &amp;amp;lt;math&amp;amp;gt;O(\log k)&amp;amp;lt;/math&amp;amp;gt; time.&lt;br /&gt;
Further, we can insert the new head of this list in the heap in &amp;amp;lt;math&amp;amp;gt;O(\log k)&amp;amp;lt;/math&amp;amp;gt;&lt;br /&gt;
time.&lt;br /&gt;
An alternate &amp;amp;lt;math&amp;amp;gt;O(n \log k)&amp;amp;lt;/math&amp;amp;gt; approach would be to&lt;br /&gt;
merge the lists from as in mergesort,&lt;br /&gt;
using a binary tree on &amp;amp;lt;math&amp;amp;gt;k&amp;amp;lt;/math&amp;amp;gt; leaves (one for each list).&lt;br /&gt;
problem&lt;/div&gt;</summary>
		<author><name>Algowikiadmin</name></author>	</entry>

	</feed>