This commit is contained in:
krahets
2026-03-31 21:20:32 +08:00
parent d4cc486ea8
commit 5519b4272a
576 changed files with 4358 additions and 70 deletions
+4
View File
@@ -72,6 +72,8 @@
<link rel="stylesheet" href="../../stylesheets/extra.css">
<link rel="stylesheet" href="../../stylesheets/animation_player.css">
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce(((e,t)=>(e<<5)-e+t.charCodeAt(0)),0),__md_get=(e,t=localStorage,a=__md_scope)=>JSON.parse(t.getItem(("__palette"===e?"/":a.pathname)+"."+e)),__md_set=(e,t,a=localStorage,_=__md_scope)=>{try{a.setItem(("__palette"===e?"/":_.pathname)+"."+e,JSON.stringify(t))}catch(e){}},document.documentElement.setAttribute("data-platform",navigator.platform)</script>
@@ -4746,6 +4748,8 @@ aria-label="フッター"
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.min.js"></script>
<script src="../../javascripts/animation_player.js"></script>
</body>
</html>
+6 -2
View File
@@ -72,6 +72,8 @@
<link rel="stylesheet" href="../../stylesheets/extra.css">
<link rel="stylesheet" href="../../stylesheets/animation_player.css">
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce(((e,t)=>(e<<5)-e+t.charCodeAt(0)),0),__md_get=(e,t=localStorage,a=__md_scope)=>JSON.parse(t.getItem(("__palette"===e?"/":a.pathname)+"."+e)),__md_set=(e,t,a=localStorage,_=__md_scope)=>{try{a.setItem(("__palette"===e?"/":_.pathname)+"."+e,JSON.stringify(t))}catch(e){}},document.documentElement.setAttribute("data-platform",navigator.platform)</script>
@@ -4386,7 +4388,7 @@
<li><strong>頂点の削除</strong>:隣接行列から 1 行 1 列を削除します。先頭行と先頭列を削除する場合が最悪で、<span class="arithmatex">\((n-1)^2\)</span> 個の要素を「左上へ移動」させる必要があるため、<span class="arithmatex">\(O(n^2)\)</span> 時間です。</li>
<li><strong>初期化</strong><span class="arithmatex">\(n\)</span> 個の頂点を受け取り、長さ <span class="arithmatex">\(n\)</span> の頂点リスト <code>vertices</code> を初期化するのに <span class="arithmatex">\(O(n)\)</span> 時間、サイズ <span class="arithmatex">\(n \times n\)</span> の隣接行列 <code>adjMat</code> を初期化するのに <span class="arithmatex">\(O(n^2)\)</span> 時間かかります。</li>
</ul>
<div class="tabbed-set tabbed-alternate" data-tabs="1:5"><input checked="checked" id="__tabbed_1_1" name="__tabbed_1" type="radio" /><input id="__tabbed_1_2" name="__tabbed_1" type="radio" /><input id="__tabbed_1_3" name="__tabbed_1" type="radio" /><input id="__tabbed_1_4" name="__tabbed_1" type="radio" /><input id="__tabbed_1_5" name="__tabbed_1" type="radio" /><div class="tabbed-labels"><label for="__tabbed_1_1">隣接行列の初期化</label><label for="__tabbed_1_2">辺の追加</label><label for="__tabbed_1_3">辺の削除</label><label for="__tabbed_1_4">頂点の追加</label><label for="__tabbed_1_5">頂点の削除</label></div>
<div class="tabbed-set tabbed-alternate" data-tabs="1:5"><input checked="checked" id="__tabbed_1_1" name="__tabbed_1" type="radio" /><input id="__tabbed_1_2" name="__tabbed_1" type="radio" /><input id="__tabbed_1_3" name="__tabbed_1" type="radio" /><input id="__tabbed_1_4" name="__tabbed_1" type="radio" /><input id="__tabbed_1_5" name="__tabbed_1" type="radio" /><div class="tabbed-labels"><label for="__tabbed_1_1">&lt;1&gt;</label><label for="__tabbed_1_2">&lt;2&gt;</label><label for="__tabbed_1_3">&lt;3&gt;</label><label for="__tabbed_1_4">&lt;4&gt;</label><label for="__tabbed_1_5">&lt;5&gt;</label></div>
<div class="tabbed-content">
<div class="tabbed-block">
<p><img alt="隣接行列の初期化、辺の追加と削除、頂点の追加と削除" class="animation-figure" src="../graph_operations.assets/adjacency_matrix_step1_initialization.png" /></p>
@@ -5572,7 +5574,7 @@
<li><strong>頂点の削除</strong>:隣接リスト全体を走査し、指定した頂点を含むすべての辺を削除する必要があるため、<span class="arithmatex">\(O(n + m)\)</span> 時間です。</li>
<li><strong>初期化</strong>:隣接リストに <span class="arithmatex">\(n\)</span> 個の頂点と <span class="arithmatex">\(2m\)</span> 本の辺を作成するため、<span class="arithmatex">\(O(n + m)\)</span> 時間です。</li>
</ul>
<div class="tabbed-set tabbed-alternate" data-tabs="3:5"><input checked="checked" id="__tabbed_3_1" name="__tabbed_3" type="radio" /><input id="__tabbed_3_2" name="__tabbed_3" type="radio" /><input id="__tabbed_3_3" name="__tabbed_3" type="radio" /><input id="__tabbed_3_4" name="__tabbed_3" type="radio" /><input id="__tabbed_3_5" name="__tabbed_3" type="radio" /><div class="tabbed-labels"><label for="__tabbed_3_1">隣接リストの初期化</label><label for="__tabbed_3_2">辺の追加</label><label for="__tabbed_3_3">辺の削除</label><label for="__tabbed_3_4">頂点の追加</label><label for="__tabbed_3_5">頂点の削除</label></div>
<div class="tabbed-set tabbed-alternate" data-tabs="3:5"><input checked="checked" id="__tabbed_3_1" name="__tabbed_3" type="radio" /><input id="__tabbed_3_2" name="__tabbed_3" type="radio" /><input id="__tabbed_3_3" name="__tabbed_3" type="radio" /><input id="__tabbed_3_4" name="__tabbed_3" type="radio" /><input id="__tabbed_3_5" name="__tabbed_3" type="radio" /><div class="tabbed-labels"><label for="__tabbed_3_1">&lt;1&gt;</label><label for="__tabbed_3_2">&lt;2&gt;</label><label for="__tabbed_3_3">&lt;3&gt;</label><label for="__tabbed_3_4">&lt;4&gt;</label><label for="__tabbed_3_5">&lt;5&gt;</label></div>
<div class="tabbed-content">
<div class="tabbed-block">
<p><img alt="隣接リストの初期化、辺の追加と削除、頂点の追加と削除" class="animation-figure" src="../graph_operations.assets/adjacency_list_step1_initialization.png" /></p>
@@ -6972,6 +6974,8 @@ aria-label="フッター"
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.min.js"></script>
<script src="../../javascripts/animation_player.js"></script>
</body>
</html>
@@ -72,6 +72,8 @@
<link rel="stylesheet" href="../../stylesheets/extra.css">
<link rel="stylesheet" href="../../stylesheets/animation_player.css">
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce(((e,t)=>(e<<5)-e+t.charCodeAt(0)),0),__md_get=(e,t=localStorage,a=__md_scope)=>JSON.parse(t.getItem(("__palette"===e?"/":a.pathname)+"."+e)),__md_set=(e,t,a=localStorage,_=__md_scope)=>{try{a.setItem(("__palette"===e?"/":_.pathname)+"."+e,JSON.stringify(t))}catch(e){}},document.documentElement.setAttribute("data-platform",navigator.platform)</script>
@@ -5616,6 +5618,8 @@ aria-label="フッター"
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.min.js"></script>
<script src="../../javascripts/animation_player.js"></script>
</body>
</html>
+4
View File
@@ -72,6 +72,8 @@
<link rel="stylesheet" href="../stylesheets/extra.css">
<link rel="stylesheet" href="../stylesheets/animation_player.css">
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,t)=>(e<<5)-e+t.charCodeAt(0)),0),__md_get=(e,t=localStorage,a=__md_scope)=>JSON.parse(t.getItem(("__palette"===e?"/":a.pathname)+"."+e)),__md_set=(e,t,a=localStorage,_=__md_scope)=>{try{a.setItem(("__palette"===e?"/":_.pathname)+"."+e,JSON.stringify(t))}catch(e){}},document.documentElement.setAttribute("data-platform",navigator.platform)</script>
@@ -4503,6 +4505,8 @@ aria-label="フッター"
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.min.js"></script>
<script src="../javascripts/animation_player.js"></script>
</body>
</html>
+4
View File
@@ -72,6 +72,8 @@
<link rel="stylesheet" href="../../stylesheets/extra.css">
<link rel="stylesheet" href="../../stylesheets/animation_player.css">
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce(((e,t)=>(e<<5)-e+t.charCodeAt(0)),0),__md_get=(e,t=localStorage,a=__md_scope)=>JSON.parse(t.getItem(("__palette"===e?"/":a.pathname)+"."+e)),__md_set=(e,t,a=localStorage,_=__md_scope)=>{try{a.setItem(("__palette"===e?"/":_.pathname)+"."+e,JSON.stringify(t))}catch(e){}},document.documentElement.setAttribute("data-platform",navigator.platform)</script>
@@ -4593,6 +4595,8 @@ aria-label="フッター"
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.min.js"></script>
<script src="../../javascripts/animation_player.js"></script>
</body>
</html>