<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://algorist.com/algowiki_v2/index.php?feed=atom&amp;namespace=0&amp;title=Special%3ANewPages</id>
		<title>Algorithm Wiki - New pages [en]</title>
		<link rel="self" type="application/atom+xml" href="https://algorist.com/algowiki_v2/index.php?feed=atom&amp;namespace=0&amp;title=Special%3ANewPages"/>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/Special:NewPages"/>
		<updated>2026-04-30T19:25:29Z</updated>
		<subtitle>From Algorithm Wiki</subtitle>
		<generator>MediaWiki 1.28.0</generator>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/YouEnTiVi</id>
		<title>YouEnTiVi</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/YouEnTiVi"/>
				<updated>2020-07-31T10:09:52Z</updated>
		
		<summary type="html">&lt;p&gt;Matt: Removed spam.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FuckMatt</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/UNTV</id>
		<title>UNTV</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/UNTV"/>
				<updated>2020-07-31T10:06:00Z</updated>
		
		<summary type="html">&lt;p&gt;Matt: Removed spam.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FuckMatt</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/Eat_diver</id>
		<title>Eat diver</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/Eat_diver"/>
				<updated>2020-07-29T14:27:00Z</updated>
		
		<summary type="html">&lt;p&gt;Matt: Removed spam.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FuckMatt</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/Portal:Science</id>
		<title>Portal:Science</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/Portal:Science"/>
				<updated>2020-07-29T14:23:43Z</updated>
		
		<summary type="html">&lt;p&gt;Matt: Removed spam.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FuckMatt</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/Portal:Mathematics</id>
		<title>Portal:Mathematics</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/Portal:Mathematics"/>
				<updated>2020-07-29T14:23:12Z</updated>
		
		<summary type="html">&lt;p&gt;Matt: Removed spam.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FuckMatt</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/Portal:History</id>
		<title>Portal:History</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/Portal:History"/>
				<updated>2020-07-29T14:22:48Z</updated>
		
		<summary type="html">&lt;p&gt;Matt: Removed spam.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FuckMatt</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/Portal:Geography</id>
		<title>Portal:Geography</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/Portal:Geography"/>
				<updated>2020-07-29T14:22:35Z</updated>
		
		<summary type="html">&lt;p&gt;Matt: Undo revision 1046 by FuckMatt (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FuckMatt</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/TADM2E_5.33</id>
		<title>TADM2E 5.33</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/TADM2E_5.33"/>
				<updated>2020-07-29T11:11:28Z</updated>
		
		<summary type="html">&lt;p&gt;Matt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''There is no problem 5.33 in the textbook. This page can be ignored.''&lt;/div&gt;</summary>
		<author><name>MattWars</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/Shot</id>
		<title>Shot</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/Shot"/>
				<updated>2020-07-27T10:22:47Z</updated>
		
		<summary type="html">&lt;p&gt;Matt: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MattWars</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/Sore</id>
		<title>Sore</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/Sore"/>
				<updated>2020-07-27T10:22:31Z</updated>
		
		<summary type="html">&lt;p&gt;Matt: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MattWars</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/TADM2E_6.10</id>
		<title>TADM2E 6.10</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/TADM2E_6.10"/>
				<updated>2020-07-22T15:39:00Z</updated>
		
		<summary type="html">&lt;p&gt;Bkarpov96: Undo revision 877 | Why are u doing this? What's the point? It's wiki for learning book&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
1. DFS from any vertex when found back edge add it to F.&lt;br /&gt;
2. Applying the Kruskal's algorithm&lt;br /&gt;
- First multiply the weights of all edges by -1&lt;br /&gt;
- If an edge is found during the algorithm execution, both ends of which belong to the same component, add it to F&lt;br /&gt;
By multiplying all edges by -1, the edges with the highest weight will be processed first =&amp;gt; the edges with the lowest weight will be added to F&lt;br /&gt;
An alternative statement of the problem from point 2 is to find the complement to the maximum spanning tree.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
--[[User:Bkarpov96|Bkarpov96]] ([[User talk:Bkarpov96|talk]]) 15:38, 22 July 2020 (UTC)&lt;/div&gt;</summary>
		<author><name>Bkarpov96</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/PHILIPPINES_2000</id>
		<title>PHILIPPINES 2000</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/PHILIPPINES_2000"/>
				<updated>2020-07-17T02:53:00Z</updated>
		
		<summary type="html">&lt;p&gt;Ufsuraifs: Created page with &amp;quot;Andito na si swabe&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Andito na si swabe&lt;/div&gt;</summary>
		<author><name>Ufsuraifs</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/SpEc</id>
		<title>SpEc</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/SpEc"/>
				<updated>2020-07-17T02:52:14Z</updated>
		
		<summary type="html">&lt;p&gt;Ufsuraifs: Created page with &amp;quot;DhajraltiariakaehE6lDhxhHrrsdhrualaleyraylalrhLryqlehsfjtslrusfstiwfaztiststagtiwwtsykgzsytavstissfjs vfsstusg;d6osgjpmfeyfpirlxteu&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;DhajraltiariakaehE6lDhxhHrrsdhrualaleyraylalrhLryqlehsfjtslrusfstiwfaztiststagtiwwtsykgzsytavstissfjs vfsstusg;d6osgjpmfeyfpirlxteu&lt;/div&gt;</summary>
		<author><name>Ufsuraifs</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/A</id>
		<title>A</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/A"/>
				<updated>2020-07-14T01:53:06Z</updated>
		
		<summary type="html">&lt;p&gt;FuckYou: Created page with &amp;quot;[En.wikipedia.org]&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[En.wikipedia.org]&lt;/div&gt;</summary>
		<author><name>FuckYou</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/EthanGamer</id>
		<title>EthanGamer</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/EthanGamer"/>
				<updated>2020-07-14T01:43:22Z</updated>
		
		<summary type="html">&lt;p&gt;FuckYou: Created page with &amp;quot;Hey Gamers!!!!!&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hey Gamers!!!!!&lt;/div&gt;</summary>
		<author><name>FuckYou</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/TADM2E_5.22</id>
		<title>TADM2E 5.22</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/TADM2E_5.22"/>
				<updated>2020-07-07T08:17:40Z</updated>
		
		<summary type="html">&lt;p&gt;Matt: Undo revision 1064 by FuckMatt (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Working with the list of edges of an undirected graph G&lt;br /&gt;
Read the edges of G and create an adjacency matrix A, and simultaneously calculate the degree of each vertex in the array B  # O(m)&lt;br /&gt;
- Consider an edge UW, if the data about it already exists A[U][W] == A[W][U] == 1, then a multiple edge is found, skip it&lt;br /&gt;
Initialize the queue Q&lt;br /&gt;
Add to Q all vertexes whose degree is 2  # O(n) iterations, O(1) get the vertex degree via the array B&lt;br /&gt;
- The presence of a vertex in the queue is noted in the array C, which consists of bool flags&lt;br /&gt;
Loop until the queue Q is empty:  # O(n) iterations&lt;br /&gt;
- Extract vertex V from Q  # V has degree 2 =&amp;gt; V located between vertexes U and W&lt;br /&gt;
- Delete the edge UV, B[U] -= 1&lt;br /&gt;
- Delete the edge VW, B[W] -= 1&lt;br /&gt;
- Delete vertex V, C[V] = False&lt;br /&gt;
- If U and W are not adjacent, connect U and W with an edge and increase the degrees of U and W by 1  # Checking the adjacency O(1) via the adjacency matrix&lt;br /&gt;
- If U's degree is 2 and U is not in queue Q, add U to Q  # Getting vertex degree via B O(1), checking for presence in the queue via C O(1) &lt;br /&gt;
- If W's degree is 2 and W is not in queue Q, add W to Q&lt;br /&gt;
&amp;lt;/pre&amp;gt;--[[User:Bkarpov96|Bkarpov96]] ([[User talk:Bkarpov96|talk]]) 08:17, 7 July 2020 (UTC)&lt;/div&gt;</summary>
		<author><name>Bkarpov96</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/TADM2E_5.20</id>
		<title>TADM2E 5.20</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/TADM2E_5.20"/>
				<updated>2020-07-06T08:53:31Z</updated>
		
		<summary type="html">&lt;p&gt;Bkarpov96: Undo revision 884 | Why are u doing this? What's the point? It's wiki for learning book&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Traversing the graph G DFS O(n + m)&lt;br /&gt;
- If vertex M has degree &amp;gt;= k, add it to U&lt;br /&gt;
- - If vertex J (parent of M) was added to U, then add an edge MJ to R&lt;br /&gt;
- Continue DFS for children of vertex M with the pointer on M and a flag indicating whether M was added to U&lt;br /&gt;
&lt;br /&gt;
Since the condition requires finding the maximum induced subgraph, all matching vertexes and edges are added during the DFS.&lt;br /&gt;
If U and R do not contain elements at the end of the DFS, then the induced subgraph does not exist.&lt;br /&gt;
&amp;lt;/pre&amp;gt;--[[User:Bkarpov96|Bkarpov96]] ([[User talk:Bkarpov96|talk]]) 08:53, 6 July 2020 (UTC)&lt;/div&gt;</summary>
		<author><name>Bkarpov96</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/TADM2E_5.12</id>
		<title>TADM2E 5.12</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/TADM2E_5.12"/>
				<updated>2020-06-30T07:48:08Z</updated>
		
		<summary type="html">&lt;p&gt;Matt: Undo revision 1145 by FuckyouMatt (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;Algorithm:&lt;br /&gt;
BFS of each vertex v ∈ V, O(|V| * (|V| + |E|))&lt;br /&gt;
Saving adjacent vertexes to an adjacency matrix or adjacency list O(1)&lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
BFS stops at a depth of 2&lt;br /&gt;
- Depth 1-adjacent v in the original graph&lt;br /&gt;
- Depth 2-adjacent v in the graph square&lt;br /&gt;
BFS uses the vertex statuses unopened, open, and processed&lt;br /&gt;
- Open and processed vertexes are not added to the queue again&lt;br /&gt;
&lt;br /&gt;
Time complexity of the algorithm O (|V| * (|V| + |E|)) = O((|V|)^2 + |V * E|)) = O(|V * E|)&lt;br /&gt;
- The number of edges does not grow slower than the number of vertexes&lt;br /&gt;
- In a graph of 1 vertex, when adding 1 vertex, 1+ edge is added&lt;br /&gt;
- In a complete graph of n vertices, the number of edges is determined by the Handshaking lemma&lt;br /&gt;
- - For a complete directed graph |E| = n * (n - 1) edges&lt;br /&gt;
- - For a complete not directed graph |E| = n * (n - 1) / 2 edges&amp;lt;/pre&amp;gt;&lt;br /&gt;
--[[User:Bkarpov96|Bkarpov96]] ([[User talk:Bkarpov96|talk]]) 07:48, 30 June 2020 (UTC)&lt;/div&gt;</summary>
		<author><name>Bkarpov96</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/TADM2E_5.10</id>
		<title>TADM2E 5.10</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/TADM2E_5.10"/>
				<updated>2020-06-29T16:13:25Z</updated>
		
		<summary type="html">&lt;p&gt;Bkarpov96: Undo revision 861 by Bkarpov96Wars (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Pre-ordered DFS: process left, process right, process current&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
If current node is number:&lt;br /&gt;
	return number&lt;br /&gt;
&lt;br /&gt;
If current node is calculation:&lt;br /&gt;
	do calulation on DFS(left_child) and DFS(right_child)&lt;br /&gt;
	save result in current node&lt;br /&gt;
	forget edges to children&lt;br /&gt;
	return number&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Modification from 5.9 - reduction of nodes.&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Bkarpov96|Bkarpov96]] ([[User talk:Bkarpov96|talk]]) 16:13, 29 June 2020 (UTC)&lt;/div&gt;</summary>
		<author><name>Bkarpov96</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/TADM2E_4.18</id>
		<title>TADM2E 4.18</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/TADM2E_4.18"/>
				<updated>2020-06-19T17:36:21Z</updated>
		
		<summary type="html">&lt;p&gt;Bkarpov96: Undo revision 887 | Why are u doing this? What's the point? It's wiki for learning book&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
from random import choices&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def group_by_color(data, start, stop, color):&lt;br /&gt;
    operations_counter = 0&lt;br /&gt;
&lt;br /&gt;
    while start &amp;lt; stop and start &amp;lt; len(data) and stop &amp;gt;= 0:&lt;br /&gt;
        # data[start] is equal to examine(data[start]) except swap function call&lt;br /&gt;
&lt;br /&gt;
        while start &amp;lt; len(data) and data[start] == color:  # Finding first element with incorrect color from start&lt;br /&gt;
            start += 1  # Element with correct color already on right position, moving forward&lt;br /&gt;
            operations_counter += 1&lt;br /&gt;
&lt;br /&gt;
        while start &amp;lt; stop and stop &amp;gt;= 0 and data[stop] != color:  # Finding first element with correct color from end&lt;br /&gt;
            stop -= 1  # Element with incorrect color will be swapped later or keep on that position, moving backward&lt;br /&gt;
            operations_counter += 1&lt;br /&gt;
&lt;br /&gt;
        if start &amp;lt; stop:&lt;br /&gt;
            data[start], data[stop] = data[stop], data[start]  # Equal to swap(start, stop)&lt;br /&gt;
            operations_counter += 1&lt;br /&gt;
&lt;br /&gt;
    assert operations_counter &amp;lt;= len(data) * 2  # Check O(2*n) restriction&lt;br /&gt;
    return start  # Return last element with specified color&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
colors_list = choices(['red', 'white', 'blue'], k=100)&lt;br /&gt;
red_ending = group_by_color(colors_list, 0, len(colors_list) - 1, 'red')  # Sort red O(n)&lt;br /&gt;
group_by_color(colors_list, red_ending + 1, len(colors_list) - 1, 'white')  # Sort white O(n)&lt;br /&gt;
# Blue already sorted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First pass: group red elements from 0 to k. Swapping not red elements found from begin and red elements found from end.&lt;br /&gt;
&lt;br /&gt;
Second pass: group white elements from k to j. Swapping not white elements from k and white elements from end.&lt;br /&gt;
&lt;br /&gt;
Blue elements already groupped from j to n.&lt;br /&gt;
&lt;br /&gt;
--[[User:Bkarpov96|Bkarpov96]] ([[User talk:Bkarpov96|talk]]) 17:36, 19 June 2020 (UTC)&lt;/div&gt;</summary>
		<author><name>Bkarpov96</name></author>	</entry>

	<entry>
		<id>https://algorist.com/algowiki_v2/index.php/TADM2E_2.34</id>
		<title>TADM2E 2.34</title>
		<link rel="alternate" type="text/html" href="https://algorist.com/algowiki_v2/index.php/TADM2E_2.34"/>
				<updated>2020-05-27T07:06:54Z</updated>
		
		<summary type="html">&lt;p&gt;Ur3000: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This task refers to this song The_Twelve_Days_of_Christmas_(song)&lt;br /&gt;
&lt;br /&gt;
So we have to calculate the sum like this&lt;br /&gt;
&lt;br /&gt;
1 day - 1 gift&lt;br /&gt;
&lt;br /&gt;
2 day - 1 gift + 2 gifts&lt;br /&gt;
&lt;br /&gt;
3 day - 1 + 2 + 3&lt;br /&gt;
&lt;br /&gt;
n day - 1 + 2 + 3 + ... + n&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Formula is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
&lt;br /&gt;
&amp;amp;\sum_{i=1}^n \sum_{j=1}^n j\&lt;br /&gt;
= \sum_{i=1}^n \frac{n(n+1)}{2} =\\&lt;br /&gt;
&amp;amp;= \frac{1}{2}\sum_{i=1}^n n^2 + \frac{1}{2}\sum_{i=1}^n n=\\&lt;br /&gt;
&amp;amp;= \frac{n(n+1)(2n+1) + 3n(n+1)}{12} = \frac{(n+1)(n^2+2n)}{6}\&lt;br /&gt;
&lt;br /&gt;
\end{align}&lt;br /&gt;
 &amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ur3000</name></author>	</entry>

	</feed>