mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-26 12:56:32 +08:00
deploy
This commit is contained in:
parent
60eb82b66b
commit
e5237ad99c
10 changed files with 614 additions and 387 deletions
|
@ -3527,385 +3527,612 @@
|
||||||
|
|
||||||
<!-- Page content -->
|
<!-- Page content -->
|
||||||
<h1 id="163">16.3 术语表<a class="headerlink" href="#163" title="Permanent link">¶</a></h1>
|
<h1 id="163">16.3 术语表<a class="headerlink" href="#163" title="Permanent link">¶</a></h1>
|
||||||
<p>表 16-1 列出了书中出现的重要术语。建议读者同时记住它们的中英文叫法,以便阅读英文文献。</p>
|
<p>表 16-1 列出了书中出现的重要术语,值得注意以下几点。</p>
|
||||||
|
<ul>
|
||||||
|
<li>部分名词在简体中文和繁体中文下的叫法不同。</li>
|
||||||
|
<li>建议记住名词的英文叫法,以便阅读英文文献。</li>
|
||||||
|
</ul>
|
||||||
<p align="center"> 表 16-1 数据结构与算法的重要名词 </p>
|
<p align="center"> 表 16-1 数据结构与算法的重要名词 </p>
|
||||||
|
|
||||||
<div class="center-table">
|
<div class="center-table">
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>中文</th>
|
|
||||||
<th>English</th>
|
|
||||||
<th>中文</th>
|
|
||||||
<th>English</th>
|
<th>English</th>
|
||||||
|
<th>简体中文</th>
|
||||||
|
<th>繁体中文</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>算法</td>
|
|
||||||
<td>algorithm</td>
|
<td>algorithm</td>
|
||||||
<td>AVL 树</td>
|
<td>算法</td>
|
||||||
<td>AVL tree</td>
|
<td>算法</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>数据结构</td>
|
|
||||||
<td>data structure</td>
|
<td>data structure</td>
|
||||||
<td>红黑树</td>
|
<td>数据结构</td>
|
||||||
<td>red-black tree</td>
|
<td>資料結構</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>渐近复杂度分析</td>
|
|
||||||
<td>asymptotic complexity analysis</td>
|
<td>asymptotic complexity analysis</td>
|
||||||
<td>层序遍历</td>
|
<td>渐近复杂度分析</td>
|
||||||
<td>level-order traversal</td>
|
<td>漸近複雜度分析</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>时间复杂度</td>
|
|
||||||
<td>time complexity</td>
|
<td>time complexity</td>
|
||||||
<td>广度优先遍历</td>
|
<td>时间复杂度</td>
|
||||||
<td>breadth-first traversal</td>
|
<td>時間複雜度</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>空间复杂度</td>
|
|
||||||
<td>space complexity</td>
|
<td>space complexity</td>
|
||||||
<td>深度优先遍历</td>
|
<td>空间复杂度</td>
|
||||||
<td>depth-first traversal</td>
|
<td>空間複雜度</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>迭代</td>
|
|
||||||
<td>iteration</td>
|
<td>iteration</td>
|
||||||
<td>二叉搜索树</td>
|
<td>迭代</td>
|
||||||
<td>binary search tree</td>
|
<td>迭代</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>递归</td>
|
|
||||||
<td>recursion</td>
|
<td>recursion</td>
|
||||||
<td>平衡二叉搜索树</td>
|
<td>递归</td>
|
||||||
<td>balanced binary search tree</td>
|
<td>遞迴</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>尾递归</td>
|
|
||||||
<td>tail recursion</td>
|
<td>tail recursion</td>
|
||||||
<td>平衡因子</td>
|
<td>尾递归</td>
|
||||||
<td>balance factor</td>
|
<td>尾遞迴</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>递归树</td>
|
|
||||||
<td>recursion tree</td>
|
<td>recursion tree</td>
|
||||||
<td>堆</td>
|
<td>递归树</td>
|
||||||
<td>heap</td>
|
<td>遞迴樹</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>大 <span class="arithmatex">\(O\)</span> 记号</td>
|
|
||||||
<td>big-<span class="arithmatex">\(O\)</span> notation</td>
|
<td>big-<span class="arithmatex">\(O\)</span> notation</td>
|
||||||
<td>大顶堆</td>
|
<td>大 <span class="arithmatex">\(O\)</span> 记号</td>
|
||||||
<td>max heap</td>
|
<td>大 <span class="arithmatex">\(O\)</span> 記號</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>渐近上界</td>
|
|
||||||
<td>asymptotic upper bound</td>
|
<td>asymptotic upper bound</td>
|
||||||
<td>小顶堆</td>
|
<td>渐近上界</td>
|
||||||
<td>min heap</td>
|
<td>漸近上界</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>原码</td>
|
|
||||||
<td>sign-magnitude</td>
|
<td>sign-magnitude</td>
|
||||||
<td>优先队列</td>
|
<td>原码</td>
|
||||||
<td>priority queue</td>
|
<td>原碼</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>反码</td>
|
|
||||||
<td>1’s complement</td>
|
<td>1’s complement</td>
|
||||||
<td>堆化</td>
|
<td>反码</td>
|
||||||
<td>heapify</td>
|
<td>反碼</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>补码</td>
|
|
||||||
<td>2’s complement</td>
|
<td>2’s complement</td>
|
||||||
<td>Top-<span class="arithmatex">\(k\)</span> 问题</td>
|
<td>补码</td>
|
||||||
<td>Top-<span class="arithmatex">\(k\)</span> problem</td>
|
<td>補碼</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>数组</td>
|
|
||||||
<td>array</td>
|
<td>array</td>
|
||||||
<td>图</td>
|
<td>数组</td>
|
||||||
<td>graph</td>
|
<td>陣列</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>索引</td>
|
|
||||||
<td>index</td>
|
<td>index</td>
|
||||||
<td>顶点</td>
|
<td>索引</td>
|
||||||
<td>vertex</td>
|
<td>索引</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>链表</td>
|
|
||||||
<td>linked list</td>
|
<td>linked list</td>
|
||||||
<td>无向图</td>
|
<td>链表</td>
|
||||||
<td>undirected graph</td>
|
<td>連結串列</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>链表节点</td>
|
|
||||||
<td>linked list node, list node</td>
|
<td>linked list node, list node</td>
|
||||||
<td>有向图</td>
|
<td>链表节点</td>
|
||||||
<td>directed graph</td>
|
<td>連結串列節點</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>头节点</td>
|
|
||||||
<td>head node</td>
|
<td>head node</td>
|
||||||
<td>连通图</td>
|
<td>头节点</td>
|
||||||
<td>connected graph</td>
|
<td>頭節點</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>尾节点</td>
|
|
||||||
<td>tail node</td>
|
<td>tail node</td>
|
||||||
<td>非连通图</td>
|
<td>尾节点</td>
|
||||||
<td>disconnected graph</td>
|
<td>尾節點</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>列表</td>
|
|
||||||
<td>list</td>
|
<td>list</td>
|
||||||
<td>有权图</td>
|
<td>列表</td>
|
||||||
<td>weighted graph</td>
|
<td>列表</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>动态数组</td>
|
|
||||||
<td>dynamic array</td>
|
<td>dynamic array</td>
|
||||||
<td>邻接</td>
|
<td>动态数组</td>
|
||||||
<td>adjacency</td>
|
<td>動態陣列</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>硬盘</td>
|
|
||||||
<td>hard disk</td>
|
<td>hard disk</td>
|
||||||
<td>路径</td>
|
<td>硬盘</td>
|
||||||
<td>path</td>
|
<td>硬碟</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>内存</td>
|
|
||||||
<td>random-access memory (RAM)</td>
|
<td>random-access memory (RAM)</td>
|
||||||
<td>入度</td>
|
<td>内存</td>
|
||||||
<td>in-degree</td>
|
<td>內存</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>缓存</td>
|
|
||||||
<td>cache memory</td>
|
<td>cache memory</td>
|
||||||
<td>出度</td>
|
<td>缓存</td>
|
||||||
<td>out-degree</td>
|
<td>快取</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>缓存未命中</td>
|
|
||||||
<td>cache miss</td>
|
<td>cache miss</td>
|
||||||
<td>邻接矩阵</td>
|
<td>缓存未命中</td>
|
||||||
<td>adjacency matrix</td>
|
<td>快取未命中</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>缓存命中率</td>
|
|
||||||
<td>cache hit rate</td>
|
<td>cache hit rate</td>
|
||||||
<td>邻接表</td>
|
<td>缓存命中率</td>
|
||||||
<td>adjacency list</td>
|
<td>快取命中率</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>栈</td>
|
|
||||||
<td>stack</td>
|
<td>stack</td>
|
||||||
<td>广度优先搜索</td>
|
<td>栈</td>
|
||||||
<td>breadth-first search</td>
|
<td>堆疊</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>栈顶</td>
|
|
||||||
<td>top of the stack</td>
|
<td>top of the stack</td>
|
||||||
<td>深度优先搜索</td>
|
<td>栈顶</td>
|
||||||
<td>depth-first search</td>
|
<td>堆疊頂</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>栈底</td>
|
|
||||||
<td>bottom of the stack</td>
|
<td>bottom of the stack</td>
|
||||||
<td>二分查找</td>
|
<td>栈底</td>
|
||||||
<td>binary search</td>
|
<td>堆疊底</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>队列</td>
|
|
||||||
<td>queue</td>
|
<td>queue</td>
|
||||||
<td>搜索算法</td>
|
<td>队列</td>
|
||||||
<td>searching algorithm</td>
|
<td>佇列</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>双向队列</td>
|
|
||||||
<td>double-ended queue</td>
|
<td>double-ended queue</td>
|
||||||
<td>排序算法</td>
|
<td>双向队列</td>
|
||||||
<td>sorting algorithm</td>
|
<td>雙向佇列</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>队首</td>
|
|
||||||
<td>front of the queue</td>
|
<td>front of the queue</td>
|
||||||
<td>选择排序</td>
|
<td>队首</td>
|
||||||
<td>selection sort</td>
|
<td>佇列首</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>队尾</td>
|
|
||||||
<td>rear of the queue</td>
|
<td>rear of the queue</td>
|
||||||
<td>冒泡排序</td>
|
<td>队尾</td>
|
||||||
<td>bubble sort</td>
|
<td>佇列尾</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>哈希表</td>
|
|
||||||
<td>hash table</td>
|
<td>hash table</td>
|
||||||
<td>插入排序</td>
|
<td>哈希表</td>
|
||||||
<td>insertion sort</td>
|
<td>雜湊表</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>桶</td>
|
|
||||||
<td>bucket</td>
|
<td>bucket</td>
|
||||||
<td>快速排序</td>
|
<td>桶</td>
|
||||||
<td>quick sort</td>
|
<td>桶</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>哈希函数</td>
|
|
||||||
<td>hash function</td>
|
<td>hash function</td>
|
||||||
<td>归并排序</td>
|
<td>哈希函数</td>
|
||||||
<td>merge sort</td>
|
<td>雜湊函式</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>哈希冲突</td>
|
|
||||||
<td>hash collision</td>
|
<td>hash collision</td>
|
||||||
<td>堆排序</td>
|
<td>哈希冲突</td>
|
||||||
<td>heap sort</td>
|
<td>雜湊衝突</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>负载因子</td>
|
|
||||||
<td>load factor</td>
|
<td>load factor</td>
|
||||||
<td>桶排序</td>
|
<td>负载因子</td>
|
||||||
<td>bucket sort</td>
|
<td>負載因子</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>链式地址</td>
|
|
||||||
<td>separate chaining</td>
|
<td>separate chaining</td>
|
||||||
<td>计数排序</td>
|
<td>链式地址</td>
|
||||||
<td>counting sort</td>
|
<td>鏈結位址</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>开放寻址</td>
|
|
||||||
<td>open addressing</td>
|
<td>open addressing</td>
|
||||||
<td>基数排序</td>
|
<td>开放寻址</td>
|
||||||
<td>radix sort</td>
|
<td>開放定址</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>线性探测</td>
|
|
||||||
<td>linear probing</td>
|
<td>linear probing</td>
|
||||||
<td>分治</td>
|
<td>线性探测</td>
|
||||||
<td>divide and conquer</td>
|
<td>線性探查</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>懒删除</td>
|
|
||||||
<td>lazy deletion</td>
|
<td>lazy deletion</td>
|
||||||
<td>汉诺塔问题</td>
|
<td>懒删除</td>
|
||||||
<td>hanota problem</td>
|
<td>懶刪除</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>二叉树</td>
|
|
||||||
<td>binary tree</td>
|
<td>binary tree</td>
|
||||||
<td>回溯算法</td>
|
<td>二叉树</td>
|
||||||
<td>backtracking algorithm</td>
|
<td>二元樹</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>树节点</td>
|
|
||||||
<td>tree node</td>
|
<td>tree node</td>
|
||||||
<td>约束</td>
|
<td>树节点</td>
|
||||||
<td>constraint</td>
|
<td>樹節點</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>左子节点</td>
|
|
||||||
<td>left-child node</td>
|
<td>left-child node</td>
|
||||||
<td>解</td>
|
<td>左子节点</td>
|
||||||
<td>solution</td>
|
<td>左子節點</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>右子节点</td>
|
|
||||||
<td>right-child node</td>
|
<td>right-child node</td>
|
||||||
<td>状态</td>
|
<td>右子节点</td>
|
||||||
<td>state</td>
|
<td>右子節點</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>父节点</td>
|
|
||||||
<td>parent node</td>
|
<td>parent node</td>
|
||||||
<td>剪枝</td>
|
<td>父节点</td>
|
||||||
<td>pruning</td>
|
<td>父節點</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>左子树</td>
|
|
||||||
<td>left subtree</td>
|
<td>left subtree</td>
|
||||||
<td>全排列问题</td>
|
<td>左子树</td>
|
||||||
<td>permutations problem</td>
|
<td>左子樹</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>右子树</td>
|
|
||||||
<td>right subtree</td>
|
<td>right subtree</td>
|
||||||
<td>子集和问题</td>
|
<td>右子树</td>
|
||||||
<td>subset-sum problem</td>
|
<td>右子樹</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>根节点</td>
|
|
||||||
<td>root node</td>
|
<td>root node</td>
|
||||||
<td>n 皇后问题</td>
|
<td>根节点</td>
|
||||||
<td>n-queens problem</td>
|
<td>根節點</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>叶节点</td>
|
|
||||||
<td>leaf node</td>
|
<td>leaf node</td>
|
||||||
<td>动态规划</td>
|
<td>叶节点</td>
|
||||||
<td>dynamic programming</td>
|
<td>葉節點</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>边</td>
|
|
||||||
<td>edge</td>
|
<td>edge</td>
|
||||||
<td>初始状态</td>
|
<td>边</td>
|
||||||
<td>initial state</td>
|
<td>邊</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>层</td>
|
|
||||||
<td>level</td>
|
<td>level</td>
|
||||||
<td>状态转移方程</td>
|
<td>层</td>
|
||||||
<td>state-trasition equation</td>
|
<td>層</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>度</td>
|
|
||||||
<td>degree</td>
|
<td>degree</td>
|
||||||
<td>背包问题</td>
|
<td>度</td>
|
||||||
<td>knapsack problem</td>
|
<td>度</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>高度</td>
|
|
||||||
<td>height</td>
|
<td>height</td>
|
||||||
<td>编辑距离问题</td>
|
<td>高度</td>
|
||||||
<td>edit distance problem</td>
|
<td>高度</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>深度</td>
|
|
||||||
<td>depth</td>
|
<td>depth</td>
|
||||||
<td>贪心算法</td>
|
<td>深度</td>
|
||||||
<td>greedy algorithm</td>
|
<td>深度</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>完美二叉树</td>
|
|
||||||
<td>perfect binary tree</td>
|
<td>perfect binary tree</td>
|
||||||
<td></td>
|
<td>完美二叉树</td>
|
||||||
<td></td>
|
<td>完美二元樹</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>完全二叉树</td>
|
|
||||||
<td>complete binary tree</td>
|
<td>complete binary tree</td>
|
||||||
<td></td>
|
<td>完全二叉树</td>
|
||||||
<td></td>
|
<td>完全二元樹</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>完满二叉树</td>
|
|
||||||
<td>full binary tree</td>
|
<td>full binary tree</td>
|
||||||
<td></td>
|
<td>完满二叉树</td>
|
||||||
<td></td>
|
<td>完滿二元樹</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>平衡二叉树</td>
|
|
||||||
<td>balanced binary tree</td>
|
<td>balanced binary tree</td>
|
||||||
<td></td>
|
<td>平衡二叉树</td>
|
||||||
<td></td>
|
<td>平衡二元樹</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>AVL tree</td>
|
||||||
|
<td>AVL 树</td>
|
||||||
|
<td>AVL 樹</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>red-black tree</td>
|
||||||
|
<td>红黑树</td>
|
||||||
|
<td>紅黑樹</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>level-order traversal</td>
|
||||||
|
<td>层序遍历</td>
|
||||||
|
<td>層序走訪</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>breadth-first traversal</td>
|
||||||
|
<td>广度优先遍历</td>
|
||||||
|
<td>廣度優先走訪</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>depth-first traversal</td>
|
||||||
|
<td>深度优先遍历</td>
|
||||||
|
<td>深度優先走訪</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>binary search tree</td>
|
||||||
|
<td>二叉搜索树</td>
|
||||||
|
<td>二元搜尋樹</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>balanced binary search tree</td>
|
||||||
|
<td>平衡二叉搜索树</td>
|
||||||
|
<td>平衡二元搜尋樹</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>balance factor</td>
|
||||||
|
<td>平衡因子</td>
|
||||||
|
<td>平衡因子</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>heap</td>
|
||||||
|
<td>堆</td>
|
||||||
|
<td>堆</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>max heap</td>
|
||||||
|
<td>大顶堆</td>
|
||||||
|
<td>大頂堆</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>min heap</td>
|
||||||
|
<td>小顶堆</td>
|
||||||
|
<td>小頂堆</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>priority queue</td>
|
||||||
|
<td>优先队列</td>
|
||||||
|
<td>優先佇列</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>heapify</td>
|
||||||
|
<td>堆化</td>
|
||||||
|
<td>堆化</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>top-<span class="arithmatex">\(k\)</span> problem</td>
|
||||||
|
<td>Top-<span class="arithmatex">\(k\)</span> 问题</td>
|
||||||
|
<td>Top-<span class="arithmatex">\(k\)</span> 問題</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>graph</td>
|
||||||
|
<td>图</td>
|
||||||
|
<td>圖</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>vertex</td>
|
||||||
|
<td>顶点</td>
|
||||||
|
<td>頂點</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>undirected graph</td>
|
||||||
|
<td>无向图</td>
|
||||||
|
<td>無向圖</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>directed graph</td>
|
||||||
|
<td>有向图</td>
|
||||||
|
<td>有向圖</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>connected graph</td>
|
||||||
|
<td>连通图</td>
|
||||||
|
<td>連通圖</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>disconnected graph</td>
|
||||||
|
<td>非连通图</td>
|
||||||
|
<td>非連通圖</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>weighted graph</td>
|
||||||
|
<td>有权图</td>
|
||||||
|
<td>有權圖</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>adjacency</td>
|
||||||
|
<td>邻接</td>
|
||||||
|
<td>鄰接</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>path</td>
|
||||||
|
<td>路径</td>
|
||||||
|
<td>路徑</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>in-degree</td>
|
||||||
|
<td>入度</td>
|
||||||
|
<td>入度</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>out-degree</td>
|
||||||
|
<td>出度</td>
|
||||||
|
<td>出度</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>adjacency matrix</td>
|
||||||
|
<td>邻接矩阵</td>
|
||||||
|
<td>鄰接矩陣</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>adjacency list</td>
|
||||||
|
<td>邻接表</td>
|
||||||
|
<td>鄰接表</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>breadth-first search</td>
|
||||||
|
<td>广度优先搜索</td>
|
||||||
|
<td>廣度優先搜尋</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>depth-first search</td>
|
||||||
|
<td>深度优先搜索</td>
|
||||||
|
<td>深度優先搜尋</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>binary search</td>
|
||||||
|
<td>二分查找</td>
|
||||||
|
<td>二分查找</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>searching algorithm</td>
|
||||||
|
<td>搜索算法</td>
|
||||||
|
<td>搜尋演算法</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>sorting algorithm</td>
|
||||||
|
<td>排序算法</td>
|
||||||
|
<td>排序演算法</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>selection sort</td>
|
||||||
|
<td>选择排序</td>
|
||||||
|
<td>選擇排序</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>bubble sort</td>
|
||||||
|
<td>冒泡排序</td>
|
||||||
|
<td>泡沫排序</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>insertion sort</td>
|
||||||
|
<td>插入排序</td>
|
||||||
|
<td>插入排序</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>quick sort</td>
|
||||||
|
<td>快速排序</td>
|
||||||
|
<td>快速排序</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>merge sort</td>
|
||||||
|
<td>归并排序</td>
|
||||||
|
<td>合併排序</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>heap sort</td>
|
||||||
|
<td>堆排序</td>
|
||||||
|
<td>堆排序</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>bucket sort</td>
|
||||||
|
<td>桶排序</td>
|
||||||
|
<td>桶排序</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>counting sort</td>
|
||||||
|
<td>计数排序</td>
|
||||||
|
<td>計數排序</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>radix sort</td>
|
||||||
|
<td>基数排序</td>
|
||||||
|
<td>基數排序</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>divide and conquer</td>
|
||||||
|
<td>分治</td>
|
||||||
|
<td>分治</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>hanota problem</td>
|
||||||
|
<td>汉诺塔问题</td>
|
||||||
|
<td>漢諾塔問題</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>backtracking algorithm</td>
|
||||||
|
<td>回溯算法</td>
|
||||||
|
<td>回溯演算法</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>constraint</td>
|
||||||
|
<td>约束</td>
|
||||||
|
<td>約束</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>solution</td>
|
||||||
|
<td>解</td>
|
||||||
|
<td>解</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>state</td>
|
||||||
|
<td>状态</td>
|
||||||
|
<td>狀態</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>pruning</td>
|
||||||
|
<td>剪枝</td>
|
||||||
|
<td>剪枝</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>permutations problem</td>
|
||||||
|
<td>全排列问题</td>
|
||||||
|
<td>全排列問題</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>subset-sum problem</td>
|
||||||
|
<td>子集和问题</td>
|
||||||
|
<td>子集合問題</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class="arithmatex">\(n\)</span>-queens problem</td>
|
||||||
|
<td><span class="arithmatex">\(n\)</span> 皇后问题</td>
|
||||||
|
<td><span class="arithmatex">\(n\)</span> 皇后問題</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>dynamic programming</td>
|
||||||
|
<td>动态规划</td>
|
||||||
|
<td>動態規劃</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>initial state</td>
|
||||||
|
<td>初始状态</td>
|
||||||
|
<td>初始狀態</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>state-trasition equation</td>
|
||||||
|
<td>状态转移方程</td>
|
||||||
|
<td>狀態轉移方程</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>knapsack problem</td>
|
||||||
|
<td>背包问题</td>
|
||||||
|
<td>背包問題</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>edit distance problem</td>
|
||||||
|
<td>编辑距离问题</td>
|
||||||
|
<td>編輯距離問題</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>greedy algorithm</td>
|
||||||
|
<td>贪心算法</td>
|
||||||
|
<td>貪心演算法</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -5146,7 +5146,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.py</span><pre><span></span><code><a id="__codelineno-84-1" name="__codelineno-84-1" href="#__codelineno-84-1"></a><span class="k">def</span> <span class="nf">quadratic</span><span class="p">(</span><span class="n">n</span><span class="p">:</span> <span class="nb">int</span><span class="p">)</span> <span class="o">-></span> <span class="nb">int</span><span class="p">:</span>
|
<div class="highlight"><span class="filename">time_complexity.py</span><pre><span></span><code><a id="__codelineno-84-1" name="__codelineno-84-1" href="#__codelineno-84-1"></a><span class="k">def</span> <span class="nf">quadratic</span><span class="p">(</span><span class="n">n</span><span class="p">:</span> <span class="nb">int</span><span class="p">)</span> <span class="o">-></span> <span class="nb">int</span><span class="p">:</span>
|
||||||
<a id="__codelineno-84-2" name="__codelineno-84-2" href="#__codelineno-84-2"></a><span class="w"> </span><span class="sd">"""平方阶"""</span>
|
<a id="__codelineno-84-2" name="__codelineno-84-2" href="#__codelineno-84-2"></a><span class="w"> </span><span class="sd">"""平方阶"""</span>
|
||||||
<a id="__codelineno-84-3" name="__codelineno-84-3" href="#__codelineno-84-3"></a> <span class="n">count</span> <span class="o">=</span> <span class="mi">0</span>
|
<a id="__codelineno-84-3" name="__codelineno-84-3" href="#__codelineno-84-3"></a> <span class="n">count</span> <span class="o">=</span> <span class="mi">0</span>
|
||||||
<a id="__codelineno-84-4" name="__codelineno-84-4" href="#__codelineno-84-4"></a> <span class="c1"># 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-84-4" name="__codelineno-84-4" href="#__codelineno-84-4"></a> <span class="c1"># 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-84-5" name="__codelineno-84-5" href="#__codelineno-84-5"></a> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
|
<a id="__codelineno-84-5" name="__codelineno-84-5" href="#__codelineno-84-5"></a> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
|
||||||
<a id="__codelineno-84-6" name="__codelineno-84-6" href="#__codelineno-84-6"></a> <span class="k">for</span> <span class="n">j</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
|
<a id="__codelineno-84-6" name="__codelineno-84-6" href="#__codelineno-84-6"></a> <span class="k">for</span> <span class="n">j</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
|
||||||
<a id="__codelineno-84-7" name="__codelineno-84-7" href="#__codelineno-84-7"></a> <span class="n">count</span> <span class="o">+=</span> <span class="mi">1</span>
|
<a id="__codelineno-84-7" name="__codelineno-84-7" href="#__codelineno-84-7"></a> <span class="n">count</span> <span class="o">+=</span> <span class="mi">1</span>
|
||||||
|
@ -5157,7 +5157,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.cpp</span><pre><span></span><code><a id="__codelineno-85-1" name="__codelineno-85-1" href="#__codelineno-85-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.cpp</span><pre><span></span><code><a id="__codelineno-85-1" name="__codelineno-85-1" href="#__codelineno-85-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-85-2" name="__codelineno-85-2" href="#__codelineno-85-2"></a><span class="kt">int</span><span class="w"> </span><span class="nf">quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-85-2" name="__codelineno-85-2" href="#__codelineno-85-2"></a><span class="kt">int</span><span class="w"> </span><span class="nf">quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-85-3" name="__codelineno-85-3" href="#__codelineno-85-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
<a id="__codelineno-85-3" name="__codelineno-85-3" href="#__codelineno-85-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-85-4" name="__codelineno-85-4" href="#__codelineno-85-4"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-85-4" name="__codelineno-85-4" href="#__codelineno-85-4"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-85-5" name="__codelineno-85-5" href="#__codelineno-85-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-85-5" name="__codelineno-85-5" href="#__codelineno-85-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-85-6" name="__codelineno-85-6" href="#__codelineno-85-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-85-6" name="__codelineno-85-6" href="#__codelineno-85-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-85-7" name="__codelineno-85-7" href="#__codelineno-85-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
<a id="__codelineno-85-7" name="__codelineno-85-7" href="#__codelineno-85-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
||||||
|
@ -5171,7 +5171,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.java</span><pre><span></span><code><a id="__codelineno-86-1" name="__codelineno-86-1" href="#__codelineno-86-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.java</span><pre><span></span><code><a id="__codelineno-86-1" name="__codelineno-86-1" href="#__codelineno-86-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-86-2" name="__codelineno-86-2" href="#__codelineno-86-2"></a><span class="kt">int</span><span class="w"> </span><span class="nf">quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-86-2" name="__codelineno-86-2" href="#__codelineno-86-2"></a><span class="kt">int</span><span class="w"> </span><span class="nf">quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-86-3" name="__codelineno-86-3" href="#__codelineno-86-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
<a id="__codelineno-86-3" name="__codelineno-86-3" href="#__codelineno-86-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-86-4" name="__codelineno-86-4" href="#__codelineno-86-4"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-86-4" name="__codelineno-86-4" href="#__codelineno-86-4"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-86-5" name="__codelineno-86-5" href="#__codelineno-86-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-86-5" name="__codelineno-86-5" href="#__codelineno-86-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-86-6" name="__codelineno-86-6" href="#__codelineno-86-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-86-6" name="__codelineno-86-6" href="#__codelineno-86-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-86-7" name="__codelineno-86-7" href="#__codelineno-86-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
<a id="__codelineno-86-7" name="__codelineno-86-7" href="#__codelineno-86-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
||||||
|
@ -5185,7 +5185,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.cs</span><pre><span></span><code><a id="__codelineno-87-1" name="__codelineno-87-1" href="#__codelineno-87-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.cs</span><pre><span></span><code><a id="__codelineno-87-1" name="__codelineno-87-1" href="#__codelineno-87-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-87-2" name="__codelineno-87-2" href="#__codelineno-87-2"></a><span class="kt">int</span><span class="w"> </span><span class="nf">Quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-87-2" name="__codelineno-87-2" href="#__codelineno-87-2"></a><span class="kt">int</span><span class="w"> </span><span class="nf">Quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-87-3" name="__codelineno-87-3" href="#__codelineno-87-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span>
|
<a id="__codelineno-87-3" name="__codelineno-87-3" href="#__codelineno-87-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-87-4" name="__codelineno-87-4" href="#__codelineno-87-4"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-87-4" name="__codelineno-87-4" href="#__codelineno-87-4"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-87-5" name="__codelineno-87-5" href="#__codelineno-87-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-87-5" name="__codelineno-87-5" href="#__codelineno-87-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-87-6" name="__codelineno-87-6" href="#__codelineno-87-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-87-6" name="__codelineno-87-6" href="#__codelineno-87-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-87-7" name="__codelineno-87-7" href="#__codelineno-87-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
<a id="__codelineno-87-7" name="__codelineno-87-7" href="#__codelineno-87-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
||||||
|
@ -5199,7 +5199,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.go</span><pre><span></span><code><a id="__codelineno-88-1" name="__codelineno-88-1" href="#__codelineno-88-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.go</span><pre><span></span><code><a id="__codelineno-88-1" name="__codelineno-88-1" href="#__codelineno-88-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-88-2" name="__codelineno-88-2" href="#__codelineno-88-2"></a><span class="kd">func</span><span class="w"> </span><span class="nx">quadratic</span><span class="p">(</span><span class="nx">n</span><span class="w"> </span><span class="kt">int</span><span class="p">)</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-88-2" name="__codelineno-88-2" href="#__codelineno-88-2"></a><span class="kd">func</span><span class="w"> </span><span class="nx">quadratic</span><span class="p">(</span><span class="nx">n</span><span class="w"> </span><span class="kt">int</span><span class="p">)</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-88-3" name="__codelineno-88-3" href="#__codelineno-88-3"></a><span class="w"> </span><span class="nx">count</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="mi">0</span>
|
<a id="__codelineno-88-3" name="__codelineno-88-3" href="#__codelineno-88-3"></a><span class="w"> </span><span class="nx">count</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="mi">0</span>
|
||||||
<a id="__codelineno-88-4" name="__codelineno-88-4" href="#__codelineno-88-4"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-88-4" name="__codelineno-88-4" href="#__codelineno-88-4"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-88-5" name="__codelineno-88-5" href="#__codelineno-88-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="p"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="o">++</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-88-5" name="__codelineno-88-5" href="#__codelineno-88-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="p"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="o">++</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-88-6" name="__codelineno-88-6" href="#__codelineno-88-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="p"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="o">++</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-88-6" name="__codelineno-88-6" href="#__codelineno-88-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="p"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="o">++</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-88-7" name="__codelineno-88-7" href="#__codelineno-88-7"></a><span class="w"> </span><span class="nx">count</span><span class="o">++</span>
|
<a id="__codelineno-88-7" name="__codelineno-88-7" href="#__codelineno-88-7"></a><span class="w"> </span><span class="nx">count</span><span class="o">++</span>
|
||||||
|
@ -5213,7 +5213,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.swift</span><pre><span></span><code><a id="__codelineno-89-1" name="__codelineno-89-1" href="#__codelineno-89-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.swift</span><pre><span></span><code><a id="__codelineno-89-1" name="__codelineno-89-1" href="#__codelineno-89-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-89-2" name="__codelineno-89-2" href="#__codelineno-89-2"></a><span class="kd">func</span> <span class="nf">quadratic</span><span class="p">(</span><span class="n">n</span><span class="p">:</span> <span class="nb">Int</span><span class="p">)</span> <span class="p">-></span> <span class="nb">Int</span> <span class="p">{</span>
|
<a id="__codelineno-89-2" name="__codelineno-89-2" href="#__codelineno-89-2"></a><span class="kd">func</span> <span class="nf">quadratic</span><span class="p">(</span><span class="n">n</span><span class="p">:</span> <span class="nb">Int</span><span class="p">)</span> <span class="p">-></span> <span class="nb">Int</span> <span class="p">{</span>
|
||||||
<a id="__codelineno-89-3" name="__codelineno-89-3" href="#__codelineno-89-3"></a> <span class="kd">var</span> <span class="nv">count</span> <span class="p">=</span> <span class="mi">0</span>
|
<a id="__codelineno-89-3" name="__codelineno-89-3" href="#__codelineno-89-3"></a> <span class="kd">var</span> <span class="nv">count</span> <span class="p">=</span> <span class="mi">0</span>
|
||||||
<a id="__codelineno-89-4" name="__codelineno-89-4" href="#__codelineno-89-4"></a> <span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-89-4" name="__codelineno-89-4" href="#__codelineno-89-4"></a> <span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-89-5" name="__codelineno-89-5" href="#__codelineno-89-5"></a> <span class="k">for</span> <span class="kc">_</span> <span class="k">in</span> <span class="mi">0</span> <span class="p">..</span><span class="o"><</span> <span class="n">n</span> <span class="p">{</span>
|
<a id="__codelineno-89-5" name="__codelineno-89-5" href="#__codelineno-89-5"></a> <span class="k">for</span> <span class="kc">_</span> <span class="k">in</span> <span class="mi">0</span> <span class="p">..</span><span class="o"><</span> <span class="n">n</span> <span class="p">{</span>
|
||||||
<a id="__codelineno-89-6" name="__codelineno-89-6" href="#__codelineno-89-6"></a> <span class="k">for</span> <span class="kc">_</span> <span class="k">in</span> <span class="mi">0</span> <span class="p">..</span><span class="o"><</span> <span class="n">n</span> <span class="p">{</span>
|
<a id="__codelineno-89-6" name="__codelineno-89-6" href="#__codelineno-89-6"></a> <span class="k">for</span> <span class="kc">_</span> <span class="k">in</span> <span class="mi">0</span> <span class="p">..</span><span class="o"><</span> <span class="n">n</span> <span class="p">{</span>
|
||||||
<a id="__codelineno-89-7" name="__codelineno-89-7" href="#__codelineno-89-7"></a> <span class="bp">count</span> <span class="o">+=</span> <span class="mi">1</span>
|
<a id="__codelineno-89-7" name="__codelineno-89-7" href="#__codelineno-89-7"></a> <span class="bp">count</span> <span class="o">+=</span> <span class="mi">1</span>
|
||||||
|
@ -5227,7 +5227,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.js</span><pre><span></span><code><a id="__codelineno-90-1" name="__codelineno-90-1" href="#__codelineno-90-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.js</span><pre><span></span><code><a id="__codelineno-90-1" name="__codelineno-90-1" href="#__codelineno-90-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-90-2" name="__codelineno-90-2" href="#__codelineno-90-2"></a><span class="kd">function</span><span class="w"> </span><span class="nx">quadratic</span><span class="p">(</span><span class="nx">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-90-2" name="__codelineno-90-2" href="#__codelineno-90-2"></a><span class="kd">function</span><span class="w"> </span><span class="nx">quadratic</span><span class="p">(</span><span class="nx">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-90-3" name="__codelineno-90-3" href="#__codelineno-90-3"></a><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nx">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span>
|
<a id="__codelineno-90-3" name="__codelineno-90-3" href="#__codelineno-90-3"></a><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nx">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-90-4" name="__codelineno-90-4" href="#__codelineno-90-4"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-90-4" name="__codelineno-90-4" href="#__codelineno-90-4"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-90-5" name="__codelineno-90-5" href="#__codelineno-90-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kd">let</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-90-5" name="__codelineno-90-5" href="#__codelineno-90-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kd">let</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-90-6" name="__codelineno-90-6" href="#__codelineno-90-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kd">let</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-90-6" name="__codelineno-90-6" href="#__codelineno-90-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kd">let</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-90-7" name="__codelineno-90-7" href="#__codelineno-90-7"></a><span class="w"> </span><span class="nx">count</span><span class="o">++</span><span class="p">;</span>
|
<a id="__codelineno-90-7" name="__codelineno-90-7" href="#__codelineno-90-7"></a><span class="w"> </span><span class="nx">count</span><span class="o">++</span><span class="p">;</span>
|
||||||
|
@ -5241,7 +5241,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.ts</span><pre><span></span><code><a id="__codelineno-91-1" name="__codelineno-91-1" href="#__codelineno-91-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.ts</span><pre><span></span><code><a id="__codelineno-91-1" name="__codelineno-91-1" href="#__codelineno-91-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-91-2" name="__codelineno-91-2" href="#__codelineno-91-2"></a><span class="kd">function</span><span class="w"> </span><span class="nx">quadratic</span><span class="p">(</span><span class="nx">n</span><span class="o">:</span><span class="w"> </span><span class="kt">number</span><span class="p">)</span><span class="o">:</span><span class="w"> </span><span class="kt">number</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-91-2" name="__codelineno-91-2" href="#__codelineno-91-2"></a><span class="kd">function</span><span class="w"> </span><span class="nx">quadratic</span><span class="p">(</span><span class="nx">n</span><span class="o">:</span><span class="w"> </span><span class="kt">number</span><span class="p">)</span><span class="o">:</span><span class="w"> </span><span class="kt">number</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-91-3" name="__codelineno-91-3" href="#__codelineno-91-3"></a><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nx">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span>
|
<a id="__codelineno-91-3" name="__codelineno-91-3" href="#__codelineno-91-3"></a><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nx">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-91-4" name="__codelineno-91-4" href="#__codelineno-91-4"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-91-4" name="__codelineno-91-4" href="#__codelineno-91-4"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-91-5" name="__codelineno-91-5" href="#__codelineno-91-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kd">let</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-91-5" name="__codelineno-91-5" href="#__codelineno-91-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kd">let</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-91-6" name="__codelineno-91-6" href="#__codelineno-91-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kd">let</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-91-6" name="__codelineno-91-6" href="#__codelineno-91-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kd">let</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-91-7" name="__codelineno-91-7" href="#__codelineno-91-7"></a><span class="w"> </span><span class="nx">count</span><span class="o">++</span><span class="p">;</span>
|
<a id="__codelineno-91-7" name="__codelineno-91-7" href="#__codelineno-91-7"></a><span class="w"> </span><span class="nx">count</span><span class="o">++</span><span class="p">;</span>
|
||||||
|
@ -5255,7 +5255,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.dart</span><pre><span></span><code><a id="__codelineno-92-1" name="__codelineno-92-1" href="#__codelineno-92-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.dart</span><pre><span></span><code><a id="__codelineno-92-1" name="__codelineno-92-1" href="#__codelineno-92-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-92-2" name="__codelineno-92-2" href="#__codelineno-92-2"></a><span class="kt">int</span><span class="w"> </span><span class="n">quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-92-2" name="__codelineno-92-2" href="#__codelineno-92-2"></a><span class="kt">int</span><span class="w"> </span><span class="n">quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-92-3" name="__codelineno-92-3" href="#__codelineno-92-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span>
|
<a id="__codelineno-92-3" name="__codelineno-92-3" href="#__codelineno-92-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-92-4" name="__codelineno-92-4" href="#__codelineno-92-4"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-92-4" name="__codelineno-92-4" href="#__codelineno-92-4"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-92-5" name="__codelineno-92-5" href="#__codelineno-92-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-92-5" name="__codelineno-92-5" href="#__codelineno-92-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-92-6" name="__codelineno-92-6" href="#__codelineno-92-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-92-6" name="__codelineno-92-6" href="#__codelineno-92-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-92-7" name="__codelineno-92-7" href="#__codelineno-92-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
<a id="__codelineno-92-7" name="__codelineno-92-7" href="#__codelineno-92-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
||||||
|
@ -5269,7 +5269,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.rs</span><pre><span></span><code><a id="__codelineno-93-1" name="__codelineno-93-1" href="#__codelineno-93-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.rs</span><pre><span></span><code><a id="__codelineno-93-1" name="__codelineno-93-1" href="#__codelineno-93-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-93-2" name="__codelineno-93-2" href="#__codelineno-93-2"></a><span class="k">fn</span> <span class="nf">quadratic</span><span class="p">(</span><span class="n">n</span>: <span class="kt">i32</span><span class="p">)</span><span class="w"> </span>-> <span class="kt">i32</span> <span class="p">{</span>
|
<a id="__codelineno-93-2" name="__codelineno-93-2" href="#__codelineno-93-2"></a><span class="k">fn</span> <span class="nf">quadratic</span><span class="p">(</span><span class="n">n</span>: <span class="kt">i32</span><span class="p">)</span><span class="w"> </span>-> <span class="kt">i32</span> <span class="p">{</span>
|
||||||
<a id="__codelineno-93-3" name="__codelineno-93-3" href="#__codelineno-93-3"></a><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
<a id="__codelineno-93-3" name="__codelineno-93-3" href="#__codelineno-93-3"></a><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-93-4" name="__codelineno-93-4" href="#__codelineno-93-4"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-93-4" name="__codelineno-93-4" href="#__codelineno-93-4"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-93-5" name="__codelineno-93-5" href="#__codelineno-93-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">_</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="mi">0</span><span class="o">..</span><span class="n">n</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-93-5" name="__codelineno-93-5" href="#__codelineno-93-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">_</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="mi">0</span><span class="o">..</span><span class="n">n</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-93-6" name="__codelineno-93-6" href="#__codelineno-93-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">_</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="mi">0</span><span class="o">..</span><span class="n">n</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-93-6" name="__codelineno-93-6" href="#__codelineno-93-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">_</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="mi">0</span><span class="o">..</span><span class="n">n</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-93-7" name="__codelineno-93-7" href="#__codelineno-93-7"></a><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span>
|
<a id="__codelineno-93-7" name="__codelineno-93-7" href="#__codelineno-93-7"></a><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span>
|
||||||
|
@ -5283,7 +5283,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.c</span><pre><span></span><code><a id="__codelineno-94-1" name="__codelineno-94-1" href="#__codelineno-94-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.c</span><pre><span></span><code><a id="__codelineno-94-1" name="__codelineno-94-1" href="#__codelineno-94-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-94-2" name="__codelineno-94-2" href="#__codelineno-94-2"></a><span class="kt">int</span><span class="w"> </span><span class="nf">quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-94-2" name="__codelineno-94-2" href="#__codelineno-94-2"></a><span class="kt">int</span><span class="w"> </span><span class="nf">quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-94-3" name="__codelineno-94-3" href="#__codelineno-94-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
<a id="__codelineno-94-3" name="__codelineno-94-3" href="#__codelineno-94-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-94-4" name="__codelineno-94-4" href="#__codelineno-94-4"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-94-4" name="__codelineno-94-4" href="#__codelineno-94-4"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-94-5" name="__codelineno-94-5" href="#__codelineno-94-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-94-5" name="__codelineno-94-5" href="#__codelineno-94-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-94-6" name="__codelineno-94-6" href="#__codelineno-94-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-94-6" name="__codelineno-94-6" href="#__codelineno-94-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-94-7" name="__codelineno-94-7" href="#__codelineno-94-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
<a id="__codelineno-94-7" name="__codelineno-94-7" href="#__codelineno-94-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
||||||
|
@ -5298,7 +5298,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<a id="__codelineno-95-2" name="__codelineno-95-2" href="#__codelineno-95-2"></a><span class="k">fn</span><span class="w"> </span><span class="n">quadratic</span><span class="p">(</span><span class="n">n</span><span class="o">:</span><span class="w"> </span><span class="kt">i32</span><span class="p">)</span><span class="w"> </span><span class="kt">i32</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-95-2" name="__codelineno-95-2" href="#__codelineno-95-2"></a><span class="k">fn</span><span class="w"> </span><span class="n">quadratic</span><span class="p">(</span><span class="n">n</span><span class="o">:</span><span class="w"> </span><span class="kt">i32</span><span class="p">)</span><span class="w"> </span><span class="kt">i32</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-95-3" name="__codelineno-95-3" href="#__codelineno-95-3"></a><span class="w"> </span><span class="kr">var</span><span class="w"> </span><span class="n">count</span><span class="o">:</span><span class="w"> </span><span class="kt">i32</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
<a id="__codelineno-95-3" name="__codelineno-95-3" href="#__codelineno-95-3"></a><span class="w"> </span><span class="kr">var</span><span class="w"> </span><span class="n">count</span><span class="o">:</span><span class="w"> </span><span class="kt">i32</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-95-4" name="__codelineno-95-4" href="#__codelineno-95-4"></a><span class="w"> </span><span class="kr">var</span><span class="w"> </span><span class="n">i</span><span class="o">:</span><span class="w"> </span><span class="kt">i32</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
<a id="__codelineno-95-4" name="__codelineno-95-4" href="#__codelineno-95-4"></a><span class="w"> </span><span class="kr">var</span><span class="w"> </span><span class="n">i</span><span class="o">:</span><span class="w"> </span><span class="kt">i32</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-95-5" name="__codelineno-95-5" href="#__codelineno-95-5"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-95-5" name="__codelineno-95-5" href="#__codelineno-95-5"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-95-6" name="__codelineno-95-6" href="#__codelineno-95-6"></a><span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="o">:</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-95-6" name="__codelineno-95-6" href="#__codelineno-95-6"></a><span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="o">:</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-95-7" name="__codelineno-95-7" href="#__codelineno-95-7"></a><span class="w"> </span><span class="kr">var</span><span class="w"> </span><span class="n">j</span><span class="o">:</span><span class="w"> </span><span class="kt">i32</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
<a id="__codelineno-95-7" name="__codelineno-95-7" href="#__codelineno-95-7"></a><span class="w"> </span><span class="kr">var</span><span class="w"> </span><span class="n">j</span><span class="o">:</span><span class="w"> </span><span class="kt">i32</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-95-8" name="__codelineno-95-8" href="#__codelineno-95-8"></a><span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="o">:</span><span class="w"> </span><span class="p">(</span><span class="n">j</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-95-8" name="__codelineno-95-8" href="#__codelineno-95-8"></a><span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="o">:</span><span class="w"> </span><span class="p">(</span><span class="n">j</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
|
@ -5313,8 +5313,8 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
</div>
|
</div>
|
||||||
<details class="pythontutor">
|
<details class="pythontutor">
|
||||||
<summary>可视化运行</summary>
|
<summary>可视化运行</summary>
|
||||||
<p><div style="height: 477px; width: 100%;"><iframe class="pythontutor-iframe" src="https://pythontutor.com/iframe-embed.html#code=def%20quadratic%28n%29%20-%3E%20int%3A%0A%20%20%20%20%22%22%22%E5%B9%B3%E6%96%B9%E9%98%B6%22%22%22%0A%20%20%20%20count%20%3D%200%0A%20%20%20%20%23%20%E5%BE%AA%E7%8E%AF%E6%AC%A1%E6%95%B0%E4%B8%8E%E6%95%B0%E7%BB%84%E9%95%BF%E5%BA%A6%E6%88%90%E5%B9%B3%E6%96%B9%E5%85%B3%E7%B3%BB%0A%20%20%20%20for%20i%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20for%20j%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20count%20%2B%3D%201%0A%20%20%20%20return%20count%0A%0A%22%22%22Driver%20Code%22%22%22%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20n%20%3D%208%0A%20%20%20%20print%28%22%E8%BE%93%E5%85%A5%E6%95%B0%E6%8D%AE%E5%A4%A7%E5%B0%8F%20n%20%3D%22,%20n%29%0A%0A%20%20%20%20count%20%3D%20quadratic%28n%29%0A%20%20%20%20print%28%22%E5%B9%B3%E6%96%B9%E9%98%B6%E7%9A%84%E6%93%8D%E4%BD%9C%E6%95%B0%E9%87%8F%20%3D%22,%20count%29&codeDivHeight=472&codeDivWidth=350&cumulative=false&curInstr=3&heapPrimitives=nevernest&origin=opt-frontend.js&py=311&rawInputLstJSON=%5B%5D&textReferences=false"> </iframe></div>
|
<p><div style="height: 477px; width: 100%;"><iframe class="pythontutor-iframe" src="https://pythontutor.com/iframe-embed.html#code=def%20quadratic%28n%29%20-%3E%20int%3A%0A%20%20%20%20%22%22%22%E5%B9%B3%E6%96%B9%E9%98%B6%22%22%22%0A%20%20%20%20count%20%3D%200%0A%20%20%20%20%23%20%E5%BE%AA%E7%8E%AF%E6%AC%A1%E6%95%B0%E4%B8%8E%E6%95%B0%E6%8D%AE%E5%A4%A7%E5%B0%8F%20n%20%E6%88%90%E5%B9%B3%E6%96%B9%E5%85%B3%E7%B3%BB%0A%20%20%20%20for%20i%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20for%20j%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20count%20%2B%3D%201%0A%20%20%20%20return%20count%0A%0A%22%22%22Driver%20Code%22%22%22%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20n%20%3D%208%0A%20%20%20%20print%28%22%E8%BE%93%E5%85%A5%E6%95%B0%E6%8D%AE%E5%A4%A7%E5%B0%8F%20n%20%3D%22,%20n%29%0A%0A%20%20%20%20count%20%3D%20quadratic%28n%29%0A%20%20%20%20print%28%22%E5%B9%B3%E6%96%B9%E9%98%B6%E7%9A%84%E6%93%8D%E4%BD%9C%E6%95%B0%E9%87%8F%20%3D%22,%20count%29&codeDivHeight=472&codeDivWidth=350&cumulative=false&curInstr=3&heapPrimitives=nevernest&origin=opt-frontend.js&py=311&rawInputLstJSON=%5B%5D&textReferences=false"> </iframe></div>
|
||||||
<div style="margin-top: 5px;"><a href="https://pythontutor.com/iframe-embed.html#code=def%20quadratic%28n%29%20-%3E%20int%3A%0A%20%20%20%20%22%22%22%E5%B9%B3%E6%96%B9%E9%98%B6%22%22%22%0A%20%20%20%20count%20%3D%200%0A%20%20%20%20%23%20%E5%BE%AA%E7%8E%AF%E6%AC%A1%E6%95%B0%E4%B8%8E%E6%95%B0%E7%BB%84%E9%95%BF%E5%BA%A6%E6%88%90%E5%B9%B3%E6%96%B9%E5%85%B3%E7%B3%BB%0A%20%20%20%20for%20i%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20for%20j%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20count%20%2B%3D%201%0A%20%20%20%20return%20count%0A%0A%22%22%22Driver%20Code%22%22%22%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20n%20%3D%208%0A%20%20%20%20print%28%22%E8%BE%93%E5%85%A5%E6%95%B0%E6%8D%AE%E5%A4%A7%E5%B0%8F%20n%20%3D%22,%20n%29%0A%0A%20%20%20%20count%20%3D%20quadratic%28n%29%0A%20%20%20%20print%28%22%E5%B9%B3%E6%96%B9%E9%98%B6%E7%9A%84%E6%93%8D%E4%BD%9C%E6%95%B0%E9%87%8F%20%3D%22,%20count%29&codeDivHeight=800&codeDivWidth=600&cumulative=false&curInstr=3&heapPrimitives=nevernest&origin=opt-frontend.js&py=311&rawInputLstJSON=%5B%5D&textReferences=false" target="_blank" rel="noopener noreferrer">全屏观看 ></a></div></p>
|
<div style="margin-top: 5px;"><a href="https://pythontutor.com/iframe-embed.html#code=def%20quadratic%28n%29%20-%3E%20int%3A%0A%20%20%20%20%22%22%22%E5%B9%B3%E6%96%B9%E9%98%B6%22%22%22%0A%20%20%20%20count%20%3D%200%0A%20%20%20%20%23%20%E5%BE%AA%E7%8E%AF%E6%AC%A1%E6%95%B0%E4%B8%8E%E6%95%B0%E6%8D%AE%E5%A4%A7%E5%B0%8F%20n%20%E6%88%90%E5%B9%B3%E6%96%B9%E5%85%B3%E7%B3%BB%0A%20%20%20%20for%20i%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20for%20j%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20count%20%2B%3D%201%0A%20%20%20%20return%20count%0A%0A%22%22%22Driver%20Code%22%22%22%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20n%20%3D%208%0A%20%20%20%20print%28%22%E8%BE%93%E5%85%A5%E6%95%B0%E6%8D%AE%E5%A4%A7%E5%B0%8F%20n%20%3D%22,%20n%29%0A%0A%20%20%20%20count%20%3D%20quadratic%28n%29%0A%20%20%20%20print%28%22%E5%B9%B3%E6%96%B9%E9%98%B6%E7%9A%84%E6%93%8D%E4%BD%9C%E6%95%B0%E9%87%8F%20%3D%22,%20count%29&codeDivHeight=800&codeDivWidth=600&cumulative=false&curInstr=3&heapPrimitives=nevernest&origin=opt-frontend.js&py=311&rawInputLstJSON=%5B%5D&textReferences=false" target="_blank" rel="noopener noreferrer">全屏观看 ></a></div></p>
|
||||||
</details>
|
</details>
|
||||||
<p>图 2-10 对比了常数阶、线性阶和平方阶三种时间复杂度。</p>
|
<p>图 2-10 对比了常数阶、线性阶和平方阶三种时间复杂度。</p>
|
||||||
<p><a class="glightbox" href="../time_complexity.assets/time_complexity_constant_linear_quadratic.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="常数阶、线性阶和平方阶的时间复杂度" class="animation-figure" src="../time_complexity.assets/time_complexity_constant_linear_quadratic.png" /></a></p>
|
<p><a class="glightbox" href="../time_complexity.assets/time_complexity_constant_linear_quadratic.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="常数阶、线性阶和平方阶的时间复杂度" class="animation-figure" src="../time_complexity.assets/time_complexity_constant_linear_quadratic.png" /></a></p>
|
||||||
|
|
|
@ -3106,7 +3106,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.py</span><pre><span></span><code><a id="__codelineno-84-1" name="__codelineno-84-1" href="#__codelineno-84-1"></a><span class="k">def</span> <span class="nf">quadratic</span><span class="p">(</span><span class="n">n</span><span class="p">:</span> <span class="nb">int</span><span class="p">)</span> <span class="o">-></span> <span class="nb">int</span><span class="p">:</span>
|
<div class="highlight"><span class="filename">time_complexity.py</span><pre><span></span><code><a id="__codelineno-84-1" name="__codelineno-84-1" href="#__codelineno-84-1"></a><span class="k">def</span> <span class="nf">quadratic</span><span class="p">(</span><span class="n">n</span><span class="p">:</span> <span class="nb">int</span><span class="p">)</span> <span class="o">-></span> <span class="nb">int</span><span class="p">:</span>
|
||||||
<a id="__codelineno-84-2" name="__codelineno-84-2" href="#__codelineno-84-2"></a><span class="w"> </span><span class="sd">"""平方阶"""</span>
|
<a id="__codelineno-84-2" name="__codelineno-84-2" href="#__codelineno-84-2"></a><span class="w"> </span><span class="sd">"""平方阶"""</span>
|
||||||
<a id="__codelineno-84-3" name="__codelineno-84-3" href="#__codelineno-84-3"></a> <span class="n">count</span> <span class="o">=</span> <span class="mi">0</span>
|
<a id="__codelineno-84-3" name="__codelineno-84-3" href="#__codelineno-84-3"></a> <span class="n">count</span> <span class="o">=</span> <span class="mi">0</span>
|
||||||
<a id="__codelineno-84-4" name="__codelineno-84-4" href="#__codelineno-84-4"></a> <span class="c1"># 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-84-4" name="__codelineno-84-4" href="#__codelineno-84-4"></a> <span class="c1"># 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-84-5" name="__codelineno-84-5" href="#__codelineno-84-5"></a> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
|
<a id="__codelineno-84-5" name="__codelineno-84-5" href="#__codelineno-84-5"></a> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
|
||||||
<a id="__codelineno-84-6" name="__codelineno-84-6" href="#__codelineno-84-6"></a> <span class="k">for</span> <span class="n">j</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
|
<a id="__codelineno-84-6" name="__codelineno-84-6" href="#__codelineno-84-6"></a> <span class="k">for</span> <span class="n">j</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
|
||||||
<a id="__codelineno-84-7" name="__codelineno-84-7" href="#__codelineno-84-7"></a> <span class="n">count</span> <span class="o">+=</span> <span class="mi">1</span>
|
<a id="__codelineno-84-7" name="__codelineno-84-7" href="#__codelineno-84-7"></a> <span class="n">count</span> <span class="o">+=</span> <span class="mi">1</span>
|
||||||
|
@ -3117,7 +3117,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.cpp</span><pre><span></span><code><a id="__codelineno-85-1" name="__codelineno-85-1" href="#__codelineno-85-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.cpp</span><pre><span></span><code><a id="__codelineno-85-1" name="__codelineno-85-1" href="#__codelineno-85-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-85-2" name="__codelineno-85-2" href="#__codelineno-85-2"></a><span class="kt">int</span><span class="w"> </span><span class="nf">quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-85-2" name="__codelineno-85-2" href="#__codelineno-85-2"></a><span class="kt">int</span><span class="w"> </span><span class="nf">quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-85-3" name="__codelineno-85-3" href="#__codelineno-85-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
<a id="__codelineno-85-3" name="__codelineno-85-3" href="#__codelineno-85-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-85-4" name="__codelineno-85-4" href="#__codelineno-85-4"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-85-4" name="__codelineno-85-4" href="#__codelineno-85-4"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-85-5" name="__codelineno-85-5" href="#__codelineno-85-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-85-5" name="__codelineno-85-5" href="#__codelineno-85-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-85-6" name="__codelineno-85-6" href="#__codelineno-85-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-85-6" name="__codelineno-85-6" href="#__codelineno-85-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-85-7" name="__codelineno-85-7" href="#__codelineno-85-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
<a id="__codelineno-85-7" name="__codelineno-85-7" href="#__codelineno-85-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
||||||
|
@ -3131,7 +3131,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.java</span><pre><span></span><code><a id="__codelineno-86-1" name="__codelineno-86-1" href="#__codelineno-86-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.java</span><pre><span></span><code><a id="__codelineno-86-1" name="__codelineno-86-1" href="#__codelineno-86-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-86-2" name="__codelineno-86-2" href="#__codelineno-86-2"></a><span class="kt">int</span><span class="w"> </span><span class="nf">quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-86-2" name="__codelineno-86-2" href="#__codelineno-86-2"></a><span class="kt">int</span><span class="w"> </span><span class="nf">quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-86-3" name="__codelineno-86-3" href="#__codelineno-86-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
<a id="__codelineno-86-3" name="__codelineno-86-3" href="#__codelineno-86-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-86-4" name="__codelineno-86-4" href="#__codelineno-86-4"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-86-4" name="__codelineno-86-4" href="#__codelineno-86-4"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-86-5" name="__codelineno-86-5" href="#__codelineno-86-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-86-5" name="__codelineno-86-5" href="#__codelineno-86-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-86-6" name="__codelineno-86-6" href="#__codelineno-86-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-86-6" name="__codelineno-86-6" href="#__codelineno-86-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-86-7" name="__codelineno-86-7" href="#__codelineno-86-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
<a id="__codelineno-86-7" name="__codelineno-86-7" href="#__codelineno-86-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
||||||
|
@ -3145,7 +3145,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.cs</span><pre><span></span><code><a id="__codelineno-87-1" name="__codelineno-87-1" href="#__codelineno-87-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.cs</span><pre><span></span><code><a id="__codelineno-87-1" name="__codelineno-87-1" href="#__codelineno-87-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-87-2" name="__codelineno-87-2" href="#__codelineno-87-2"></a><span class="kt">int</span><span class="w"> </span><span class="nf">Quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-87-2" name="__codelineno-87-2" href="#__codelineno-87-2"></a><span class="kt">int</span><span class="w"> </span><span class="nf">Quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-87-3" name="__codelineno-87-3" href="#__codelineno-87-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span>
|
<a id="__codelineno-87-3" name="__codelineno-87-3" href="#__codelineno-87-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-87-4" name="__codelineno-87-4" href="#__codelineno-87-4"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-87-4" name="__codelineno-87-4" href="#__codelineno-87-4"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-87-5" name="__codelineno-87-5" href="#__codelineno-87-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-87-5" name="__codelineno-87-5" href="#__codelineno-87-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-87-6" name="__codelineno-87-6" href="#__codelineno-87-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-87-6" name="__codelineno-87-6" href="#__codelineno-87-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-87-7" name="__codelineno-87-7" href="#__codelineno-87-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
<a id="__codelineno-87-7" name="__codelineno-87-7" href="#__codelineno-87-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
||||||
|
@ -3159,7 +3159,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.go</span><pre><span></span><code><a id="__codelineno-88-1" name="__codelineno-88-1" href="#__codelineno-88-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.go</span><pre><span></span><code><a id="__codelineno-88-1" name="__codelineno-88-1" href="#__codelineno-88-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-88-2" name="__codelineno-88-2" href="#__codelineno-88-2"></a><span class="kd">func</span><span class="w"> </span><span class="nx">quadratic</span><span class="p">(</span><span class="nx">n</span><span class="w"> </span><span class="kt">int</span><span class="p">)</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-88-2" name="__codelineno-88-2" href="#__codelineno-88-2"></a><span class="kd">func</span><span class="w"> </span><span class="nx">quadratic</span><span class="p">(</span><span class="nx">n</span><span class="w"> </span><span class="kt">int</span><span class="p">)</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-88-3" name="__codelineno-88-3" href="#__codelineno-88-3"></a><span class="w"> </span><span class="nx">count</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="mi">0</span>
|
<a id="__codelineno-88-3" name="__codelineno-88-3" href="#__codelineno-88-3"></a><span class="w"> </span><span class="nx">count</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="mi">0</span>
|
||||||
<a id="__codelineno-88-4" name="__codelineno-88-4" href="#__codelineno-88-4"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-88-4" name="__codelineno-88-4" href="#__codelineno-88-4"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-88-5" name="__codelineno-88-5" href="#__codelineno-88-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="p"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="o">++</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-88-5" name="__codelineno-88-5" href="#__codelineno-88-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="p"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="o">++</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-88-6" name="__codelineno-88-6" href="#__codelineno-88-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="p"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="o">++</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-88-6" name="__codelineno-88-6" href="#__codelineno-88-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="p"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="o">++</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-88-7" name="__codelineno-88-7" href="#__codelineno-88-7"></a><span class="w"> </span><span class="nx">count</span><span class="o">++</span>
|
<a id="__codelineno-88-7" name="__codelineno-88-7" href="#__codelineno-88-7"></a><span class="w"> </span><span class="nx">count</span><span class="o">++</span>
|
||||||
|
@ -3173,7 +3173,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.swift</span><pre><span></span><code><a id="__codelineno-89-1" name="__codelineno-89-1" href="#__codelineno-89-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.swift</span><pre><span></span><code><a id="__codelineno-89-1" name="__codelineno-89-1" href="#__codelineno-89-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-89-2" name="__codelineno-89-2" href="#__codelineno-89-2"></a><span class="kd">func</span> <span class="nf">quadratic</span><span class="p">(</span><span class="n">n</span><span class="p">:</span> <span class="nb">Int</span><span class="p">)</span> <span class="p">-></span> <span class="nb">Int</span> <span class="p">{</span>
|
<a id="__codelineno-89-2" name="__codelineno-89-2" href="#__codelineno-89-2"></a><span class="kd">func</span> <span class="nf">quadratic</span><span class="p">(</span><span class="n">n</span><span class="p">:</span> <span class="nb">Int</span><span class="p">)</span> <span class="p">-></span> <span class="nb">Int</span> <span class="p">{</span>
|
||||||
<a id="__codelineno-89-3" name="__codelineno-89-3" href="#__codelineno-89-3"></a> <span class="kd">var</span> <span class="nv">count</span> <span class="p">=</span> <span class="mi">0</span>
|
<a id="__codelineno-89-3" name="__codelineno-89-3" href="#__codelineno-89-3"></a> <span class="kd">var</span> <span class="nv">count</span> <span class="p">=</span> <span class="mi">0</span>
|
||||||
<a id="__codelineno-89-4" name="__codelineno-89-4" href="#__codelineno-89-4"></a> <span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-89-4" name="__codelineno-89-4" href="#__codelineno-89-4"></a> <span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-89-5" name="__codelineno-89-5" href="#__codelineno-89-5"></a> <span class="k">for</span> <span class="kc">_</span> <span class="k">in</span> <span class="mi">0</span> <span class="p">..</span><span class="o"><</span> <span class="n">n</span> <span class="p">{</span>
|
<a id="__codelineno-89-5" name="__codelineno-89-5" href="#__codelineno-89-5"></a> <span class="k">for</span> <span class="kc">_</span> <span class="k">in</span> <span class="mi">0</span> <span class="p">..</span><span class="o"><</span> <span class="n">n</span> <span class="p">{</span>
|
||||||
<a id="__codelineno-89-6" name="__codelineno-89-6" href="#__codelineno-89-6"></a> <span class="k">for</span> <span class="kc">_</span> <span class="k">in</span> <span class="mi">0</span> <span class="p">..</span><span class="o"><</span> <span class="n">n</span> <span class="p">{</span>
|
<a id="__codelineno-89-6" name="__codelineno-89-6" href="#__codelineno-89-6"></a> <span class="k">for</span> <span class="kc">_</span> <span class="k">in</span> <span class="mi">0</span> <span class="p">..</span><span class="o"><</span> <span class="n">n</span> <span class="p">{</span>
|
||||||
<a id="__codelineno-89-7" name="__codelineno-89-7" href="#__codelineno-89-7"></a> <span class="bp">count</span> <span class="o">+=</span> <span class="mi">1</span>
|
<a id="__codelineno-89-7" name="__codelineno-89-7" href="#__codelineno-89-7"></a> <span class="bp">count</span> <span class="o">+=</span> <span class="mi">1</span>
|
||||||
|
@ -3187,7 +3187,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.js</span><pre><span></span><code><a id="__codelineno-90-1" name="__codelineno-90-1" href="#__codelineno-90-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.js</span><pre><span></span><code><a id="__codelineno-90-1" name="__codelineno-90-1" href="#__codelineno-90-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-90-2" name="__codelineno-90-2" href="#__codelineno-90-2"></a><span class="kd">function</span><span class="w"> </span><span class="nx">quadratic</span><span class="p">(</span><span class="nx">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-90-2" name="__codelineno-90-2" href="#__codelineno-90-2"></a><span class="kd">function</span><span class="w"> </span><span class="nx">quadratic</span><span class="p">(</span><span class="nx">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-90-3" name="__codelineno-90-3" href="#__codelineno-90-3"></a><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nx">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span>
|
<a id="__codelineno-90-3" name="__codelineno-90-3" href="#__codelineno-90-3"></a><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nx">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-90-4" name="__codelineno-90-4" href="#__codelineno-90-4"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-90-4" name="__codelineno-90-4" href="#__codelineno-90-4"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-90-5" name="__codelineno-90-5" href="#__codelineno-90-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kd">let</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-90-5" name="__codelineno-90-5" href="#__codelineno-90-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kd">let</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-90-6" name="__codelineno-90-6" href="#__codelineno-90-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kd">let</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-90-6" name="__codelineno-90-6" href="#__codelineno-90-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kd">let</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-90-7" name="__codelineno-90-7" href="#__codelineno-90-7"></a><span class="w"> </span><span class="nx">count</span><span class="o">++</span><span class="p">;</span>
|
<a id="__codelineno-90-7" name="__codelineno-90-7" href="#__codelineno-90-7"></a><span class="w"> </span><span class="nx">count</span><span class="o">++</span><span class="p">;</span>
|
||||||
|
@ -3201,7 +3201,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.ts</span><pre><span></span><code><a id="__codelineno-91-1" name="__codelineno-91-1" href="#__codelineno-91-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.ts</span><pre><span></span><code><a id="__codelineno-91-1" name="__codelineno-91-1" href="#__codelineno-91-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-91-2" name="__codelineno-91-2" href="#__codelineno-91-2"></a><span class="kd">function</span><span class="w"> </span><span class="nx">quadratic</span><span class="p">(</span><span class="nx">n</span><span class="o">:</span><span class="w"> </span><span class="kt">number</span><span class="p">)</span><span class="o">:</span><span class="w"> </span><span class="kt">number</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-91-2" name="__codelineno-91-2" href="#__codelineno-91-2"></a><span class="kd">function</span><span class="w"> </span><span class="nx">quadratic</span><span class="p">(</span><span class="nx">n</span><span class="o">:</span><span class="w"> </span><span class="kt">number</span><span class="p">)</span><span class="o">:</span><span class="w"> </span><span class="kt">number</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-91-3" name="__codelineno-91-3" href="#__codelineno-91-3"></a><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nx">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span>
|
<a id="__codelineno-91-3" name="__codelineno-91-3" href="#__codelineno-91-3"></a><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nx">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-91-4" name="__codelineno-91-4" href="#__codelineno-91-4"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-91-4" name="__codelineno-91-4" href="#__codelineno-91-4"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-91-5" name="__codelineno-91-5" href="#__codelineno-91-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kd">let</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-91-5" name="__codelineno-91-5" href="#__codelineno-91-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kd">let</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-91-6" name="__codelineno-91-6" href="#__codelineno-91-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kd">let</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-91-6" name="__codelineno-91-6" href="#__codelineno-91-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kd">let</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-91-7" name="__codelineno-91-7" href="#__codelineno-91-7"></a><span class="w"> </span><span class="nx">count</span><span class="o">++</span><span class="p">;</span>
|
<a id="__codelineno-91-7" name="__codelineno-91-7" href="#__codelineno-91-7"></a><span class="w"> </span><span class="nx">count</span><span class="o">++</span><span class="p">;</span>
|
||||||
|
@ -3215,7 +3215,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.dart</span><pre><span></span><code><a id="__codelineno-92-1" name="__codelineno-92-1" href="#__codelineno-92-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.dart</span><pre><span></span><code><a id="__codelineno-92-1" name="__codelineno-92-1" href="#__codelineno-92-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-92-2" name="__codelineno-92-2" href="#__codelineno-92-2"></a><span class="kt">int</span><span class="w"> </span><span class="n">quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-92-2" name="__codelineno-92-2" href="#__codelineno-92-2"></a><span class="kt">int</span><span class="w"> </span><span class="n">quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-92-3" name="__codelineno-92-3" href="#__codelineno-92-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span>
|
<a id="__codelineno-92-3" name="__codelineno-92-3" href="#__codelineno-92-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-92-4" name="__codelineno-92-4" href="#__codelineno-92-4"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-92-4" name="__codelineno-92-4" href="#__codelineno-92-4"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-92-5" name="__codelineno-92-5" href="#__codelineno-92-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-92-5" name="__codelineno-92-5" href="#__codelineno-92-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-92-6" name="__codelineno-92-6" href="#__codelineno-92-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-92-6" name="__codelineno-92-6" href="#__codelineno-92-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-92-7" name="__codelineno-92-7" href="#__codelineno-92-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
<a id="__codelineno-92-7" name="__codelineno-92-7" href="#__codelineno-92-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
||||||
|
@ -3229,7 +3229,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.rs</span><pre><span></span><code><a id="__codelineno-93-1" name="__codelineno-93-1" href="#__codelineno-93-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.rs</span><pre><span></span><code><a id="__codelineno-93-1" name="__codelineno-93-1" href="#__codelineno-93-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-93-2" name="__codelineno-93-2" href="#__codelineno-93-2"></a><span class="k">fn</span> <span class="nf">quadratic</span><span class="p">(</span><span class="n">n</span>: <span class="kt">i32</span><span class="p">)</span><span class="w"> </span>-> <span class="kt">i32</span> <span class="p">{</span>
|
<a id="__codelineno-93-2" name="__codelineno-93-2" href="#__codelineno-93-2"></a><span class="k">fn</span> <span class="nf">quadratic</span><span class="p">(</span><span class="n">n</span>: <span class="kt">i32</span><span class="p">)</span><span class="w"> </span>-> <span class="kt">i32</span> <span class="p">{</span>
|
||||||
<a id="__codelineno-93-3" name="__codelineno-93-3" href="#__codelineno-93-3"></a><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
<a id="__codelineno-93-3" name="__codelineno-93-3" href="#__codelineno-93-3"></a><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-93-4" name="__codelineno-93-4" href="#__codelineno-93-4"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-93-4" name="__codelineno-93-4" href="#__codelineno-93-4"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-93-5" name="__codelineno-93-5" href="#__codelineno-93-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">_</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="mi">0</span><span class="o">..</span><span class="n">n</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-93-5" name="__codelineno-93-5" href="#__codelineno-93-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">_</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="mi">0</span><span class="o">..</span><span class="n">n</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-93-6" name="__codelineno-93-6" href="#__codelineno-93-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">_</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="mi">0</span><span class="o">..</span><span class="n">n</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-93-6" name="__codelineno-93-6" href="#__codelineno-93-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">_</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="mi">0</span><span class="o">..</span><span class="n">n</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-93-7" name="__codelineno-93-7" href="#__codelineno-93-7"></a><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span>
|
<a id="__codelineno-93-7" name="__codelineno-93-7" href="#__codelineno-93-7"></a><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span>
|
||||||
|
@ -3243,7 +3243,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<div class="highlight"><span class="filename">time_complexity.c</span><pre><span></span><code><a id="__codelineno-94-1" name="__codelineno-94-1" href="#__codelineno-94-1"></a><span class="cm">/* 平方阶 */</span>
|
<div class="highlight"><span class="filename">time_complexity.c</span><pre><span></span><code><a id="__codelineno-94-1" name="__codelineno-94-1" href="#__codelineno-94-1"></a><span class="cm">/* 平方阶 */</span>
|
||||||
<a id="__codelineno-94-2" name="__codelineno-94-2" href="#__codelineno-94-2"></a><span class="kt">int</span><span class="w"> </span><span class="nf">quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-94-2" name="__codelineno-94-2" href="#__codelineno-94-2"></a><span class="kt">int</span><span class="w"> </span><span class="nf">quadratic</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-94-3" name="__codelineno-94-3" href="#__codelineno-94-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
<a id="__codelineno-94-3" name="__codelineno-94-3" href="#__codelineno-94-3"></a><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-94-4" name="__codelineno-94-4" href="#__codelineno-94-4"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-94-4" name="__codelineno-94-4" href="#__codelineno-94-4"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-94-5" name="__codelineno-94-5" href="#__codelineno-94-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-94-5" name="__codelineno-94-5" href="#__codelineno-94-5"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-94-6" name="__codelineno-94-6" href="#__codelineno-94-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-94-6" name="__codelineno-94-6" href="#__codelineno-94-6"></a><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-94-7" name="__codelineno-94-7" href="#__codelineno-94-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
<a id="__codelineno-94-7" name="__codelineno-94-7" href="#__codelineno-94-7"></a><span class="w"> </span><span class="n">count</span><span class="o">++</span><span class="p">;</span>
|
||||||
|
@ -3258,7 +3258,7 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
<a id="__codelineno-95-2" name="__codelineno-95-2" href="#__codelineno-95-2"></a><span class="k">fn</span><span class="w"> </span><span class="n">quadratic</span><span class="p">(</span><span class="n">n</span><span class="o">:</span><span class="w"> </span><span class="kt">i32</span><span class="p">)</span><span class="w"> </span><span class="kt">i32</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-95-2" name="__codelineno-95-2" href="#__codelineno-95-2"></a><span class="k">fn</span><span class="w"> </span><span class="n">quadratic</span><span class="p">(</span><span class="n">n</span><span class="o">:</span><span class="w"> </span><span class="kt">i32</span><span class="p">)</span><span class="w"> </span><span class="kt">i32</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-95-3" name="__codelineno-95-3" href="#__codelineno-95-3"></a><span class="w"> </span><span class="kr">var</span><span class="w"> </span><span class="n">count</span><span class="o">:</span><span class="w"> </span><span class="kt">i32</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
<a id="__codelineno-95-3" name="__codelineno-95-3" href="#__codelineno-95-3"></a><span class="w"> </span><span class="kr">var</span><span class="w"> </span><span class="n">count</span><span class="o">:</span><span class="w"> </span><span class="kt">i32</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-95-4" name="__codelineno-95-4" href="#__codelineno-95-4"></a><span class="w"> </span><span class="kr">var</span><span class="w"> </span><span class="n">i</span><span class="o">:</span><span class="w"> </span><span class="kt">i32</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
<a id="__codelineno-95-4" name="__codelineno-95-4" href="#__codelineno-95-4"></a><span class="w"> </span><span class="kr">var</span><span class="w"> </span><span class="n">i</span><span class="o">:</span><span class="w"> </span><span class="kt">i32</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-95-5" name="__codelineno-95-5" href="#__codelineno-95-5"></a><span class="w"> </span><span class="c1">// 循环次数与数组长度成平方关系</span>
|
<a id="__codelineno-95-5" name="__codelineno-95-5" href="#__codelineno-95-5"></a><span class="w"> </span><span class="c1">// 循环次数与数据大小 n 成平方关系</span>
|
||||||
<a id="__codelineno-95-6" name="__codelineno-95-6" href="#__codelineno-95-6"></a><span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="o">:</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-95-6" name="__codelineno-95-6" href="#__codelineno-95-6"></a><span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="o">:</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
<a id="__codelineno-95-7" name="__codelineno-95-7" href="#__codelineno-95-7"></a><span class="w"> </span><span class="kr">var</span><span class="w"> </span><span class="n">j</span><span class="o">:</span><span class="w"> </span><span class="kt">i32</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
<a id="__codelineno-95-7" name="__codelineno-95-7" href="#__codelineno-95-7"></a><span class="w"> </span><span class="kr">var</span><span class="w"> </span><span class="n">j</span><span class="o">:</span><span class="w"> </span><span class="kt">i32</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
||||||
<a id="__codelineno-95-8" name="__codelineno-95-8" href="#__codelineno-95-8"></a><span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="o">:</span><span class="w"> </span><span class="p">(</span><span class="n">j</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
<a id="__codelineno-95-8" name="__codelineno-95-8" href="#__codelineno-95-8"></a><span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">j</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="o">:</span><span class="w"> </span><span class="p">(</span><span class="n">j</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
||||||
|
@ -3273,8 +3273,8 @@ O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(2^n) < O(n!
|
||||||
</div>
|
</div>
|
||||||
<details class="pythontutor">
|
<details class="pythontutor">
|
||||||
<summary>Code Visualization</summary>
|
<summary>Code Visualization</summary>
|
||||||
<p><div style="height: 477px; width: 100%;"><iframe class="pythontutor-iframe" src="https://pythontutor.com/iframe-embed.html#code=def%20quadratic%28n%29%20-%3E%20int%3A%0A%20%20%20%20%22%22%22%E5%B9%B3%E6%96%B9%E9%98%B6%22%22%22%0A%20%20%20%20count%20%3D%200%0A%20%20%20%20%23%20%E5%BE%AA%E7%8E%AF%E6%AC%A1%E6%95%B0%E4%B8%8E%E6%95%B0%E7%BB%84%E9%95%BF%E5%BA%A6%E6%88%90%E5%B9%B3%E6%96%B9%E5%85%B3%E7%B3%BB%0A%20%20%20%20for%20i%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20for%20j%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20count%20%2B%3D%201%0A%20%20%20%20return%20count%0A%0A%22%22%22Driver%20Code%22%22%22%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20n%20%3D%208%0A%20%20%20%20print%28%22%E8%BE%93%E5%85%A5%E6%95%B0%E6%8D%AE%E5%A4%A7%E5%B0%8F%20n%20%3D%22,%20n%29%0A%0A%20%20%20%20count%20%3D%20quadratic%28n%29%0A%20%20%20%20print%28%22%E5%B9%B3%E6%96%B9%E9%98%B6%E7%9A%84%E6%93%8D%E4%BD%9C%E6%95%B0%E9%87%8F%20%3D%22,%20count%29&codeDivHeight=472&codeDivWidth=350&cumulative=false&curInstr=3&heapPrimitives=nevernest&origin=opt-frontend.js&py=311&rawInputLstJSON=%5B%5D&textReferences=false"> </iframe></div>
|
<p><div style="height: 477px; width: 100%;"><iframe class="pythontutor-iframe" src="https://pythontutor.com/iframe-embed.html#code=def%20quadratic%28n%29%20-%3E%20int%3A%0A%20%20%20%20%22%22%22%E5%B9%B3%E6%96%B9%E9%98%B6%22%22%22%0A%20%20%20%20count%20%3D%200%0A%20%20%20%20%23%20%E5%BE%AA%E7%8E%AF%E6%AC%A1%E6%95%B0%E4%B8%8E%E6%95%B0%E6%8D%AE%E5%A4%A7%E5%B0%8F%20n%20%E6%88%90%E5%B9%B3%E6%96%B9%E5%85%B3%E7%B3%BB%0A%20%20%20%20for%20i%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20for%20j%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20count%20%2B%3D%201%0A%20%20%20%20return%20count%0A%0A%22%22%22Driver%20Code%22%22%22%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20n%20%3D%208%0A%20%20%20%20print%28%22%E8%BE%93%E5%85%A5%E6%95%B0%E6%8D%AE%E5%A4%A7%E5%B0%8F%20n%20%3D%22,%20n%29%0A%0A%20%20%20%20count%20%3D%20quadratic%28n%29%0A%20%20%20%20print%28%22%E5%B9%B3%E6%96%B9%E9%98%B6%E7%9A%84%E6%93%8D%E4%BD%9C%E6%95%B0%E9%87%8F%20%3D%22,%20count%29&codeDivHeight=472&codeDivWidth=350&cumulative=false&curInstr=3&heapPrimitives=nevernest&origin=opt-frontend.js&py=311&rawInputLstJSON=%5B%5D&textReferences=false"> </iframe></div>
|
||||||
<div style="margin-top: 5px;"><a href="https://pythontutor.com/iframe-embed.html#code=def%20quadratic%28n%29%20-%3E%20int%3A%0A%20%20%20%20%22%22%22%E5%B9%B3%E6%96%B9%E9%98%B6%22%22%22%0A%20%20%20%20count%20%3D%200%0A%20%20%20%20%23%20%E5%BE%AA%E7%8E%AF%E6%AC%A1%E6%95%B0%E4%B8%8E%E6%95%B0%E7%BB%84%E9%95%BF%E5%BA%A6%E6%88%90%E5%B9%B3%E6%96%B9%E5%85%B3%E7%B3%BB%0A%20%20%20%20for%20i%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20for%20j%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20count%20%2B%3D%201%0A%20%20%20%20return%20count%0A%0A%22%22%22Driver%20Code%22%22%22%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20n%20%3D%208%0A%20%20%20%20print%28%22%E8%BE%93%E5%85%A5%E6%95%B0%E6%8D%AE%E5%A4%A7%E5%B0%8F%20n%20%3D%22,%20n%29%0A%0A%20%20%20%20count%20%3D%20quadratic%28n%29%0A%20%20%20%20print%28%22%E5%B9%B3%E6%96%B9%E9%98%B6%E7%9A%84%E6%93%8D%E4%BD%9C%E6%95%B0%E9%87%8F%20%3D%22,%20count%29&codeDivHeight=800&codeDivWidth=600&cumulative=false&curInstr=3&heapPrimitives=nevernest&origin=opt-frontend.js&py=311&rawInputLstJSON=%5B%5D&textReferences=false" target="_blank" rel="noopener noreferrer">Full Screen ></a></div></p>
|
<div style="margin-top: 5px;"><a href="https://pythontutor.com/iframe-embed.html#code=def%20quadratic%28n%29%20-%3E%20int%3A%0A%20%20%20%20%22%22%22%E5%B9%B3%E6%96%B9%E9%98%B6%22%22%22%0A%20%20%20%20count%20%3D%200%0A%20%20%20%20%23%20%E5%BE%AA%E7%8E%AF%E6%AC%A1%E6%95%B0%E4%B8%8E%E6%95%B0%E6%8D%AE%E5%A4%A7%E5%B0%8F%20n%20%E6%88%90%E5%B9%B3%E6%96%B9%E5%85%B3%E7%B3%BB%0A%20%20%20%20for%20i%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20for%20j%20in%20range%28n%29%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20count%20%2B%3D%201%0A%20%20%20%20return%20count%0A%0A%22%22%22Driver%20Code%22%22%22%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20n%20%3D%208%0A%20%20%20%20print%28%22%E8%BE%93%E5%85%A5%E6%95%B0%E6%8D%AE%E5%A4%A7%E5%B0%8F%20n%20%3D%22,%20n%29%0A%0A%20%20%20%20count%20%3D%20quadratic%28n%29%0A%20%20%20%20print%28%22%E5%B9%B3%E6%96%B9%E9%98%B6%E7%9A%84%E6%93%8D%E4%BD%9C%E6%95%B0%E9%87%8F%20%3D%22,%20count%29&codeDivHeight=800&codeDivWidth=600&cumulative=false&curInstr=3&heapPrimitives=nevernest&origin=opt-frontend.js&py=311&rawInputLstJSON=%5B%5D&textReferences=false" target="_blank" rel="noopener noreferrer">Full Screen ></a></div></p>
|
||||||
</details>
|
</details>
|
||||||
<p>The following image compares constant order, linear order, and quadratic order time complexities.</p>
|
<p>The following image compares constant order, linear order, and quadratic order time complexities.</p>
|
||||||
<p><a class="glightbox" href="../time_complexity.assets/time_complexity_constant_linear_quadratic.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="Constant, Linear, and Quadratic Order Time Complexities" class="animation-figure" src="../time_complexity.assets/time_complexity_constant_linear_quadratic.png" /></a></p>
|
<p><a class="glightbox" href="../time_complexity.assets/time_complexity_constant_linear_quadratic.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="Constant, Linear, and Quadratic Order Time Complexities" class="animation-figure" src="../time_complexity.assets/time_complexity_constant_linear_quadratic.png" /></a></p>
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -2,187 +2,187 @@
|
||||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/</loc>
|
<loc>https://www.hello-algo.com/en/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_array_and_linkedlist/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_array_and_linkedlist/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_array_and_linkedlist/array/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_array_and_linkedlist/array/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_array_and_linkedlist/linked_list/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_array_and_linkedlist/linked_list/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_array_and_linkedlist/list/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_array_and_linkedlist/list/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_array_and_linkedlist/ram_and_cache/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_array_and_linkedlist/ram_and_cache/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_array_and_linkedlist/summary/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_array_and_linkedlist/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_computational_complexity/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_computational_complexity/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_computational_complexity/iteration_and_recursion/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_computational_complexity/iteration_and_recursion/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_computational_complexity/performance_evaluation/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_computational_complexity/performance_evaluation/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_computational_complexity/space_complexity/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_computational_complexity/space_complexity/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_computational_complexity/summary/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_computational_complexity/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_computational_complexity/time_complexity/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_computational_complexity/time_complexity/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_data_structure/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_data_structure/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_data_structure/basic_data_types/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_data_structure/basic_data_types/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_data_structure/character_encoding/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_data_structure/character_encoding/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_data_structure/classification_of_data_structure/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_data_structure/classification_of_data_structure/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_data_structure/number_encoding/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_data_structure/number_encoding/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_data_structure/summary/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_data_structure/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_hashing/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_hashing/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_hashing/hash_algorithm/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_hashing/hash_algorithm/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_hashing/hash_collision/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_hashing/hash_collision/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_hashing/hash_map/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_hashing/hash_map/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_hashing/summary/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_hashing/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_introduction/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_introduction/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_introduction/algorithms_are_everywhere/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_introduction/algorithms_are_everywhere/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_introduction/summary/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_introduction/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_introduction/what_is_dsa/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_introduction/what_is_dsa/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_preface/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_preface/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_preface/about_the_book/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_preface/about_the_book/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_preface/suggestions/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_preface/suggestions/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_preface/summary/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_preface/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_stack_and_queue/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_stack_and_queue/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_stack_and_queue/deque/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_stack_and_queue/deque/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_stack_and_queue/queue/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_stack_and_queue/queue/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_stack_and_queue/stack/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_stack_and_queue/stack/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/en/chapter_stack_and_queue/summary/</loc>
|
<loc>https://www.hello-algo.com/en/chapter_stack_and_queue/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
</urlset>
|
</urlset>
|
Binary file not shown.
File diff suppressed because one or more lines are too long
210
sitemap.xml
210
sitemap.xml
|
@ -2,527 +2,527 @@
|
||||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/</loc>
|
<loc>https://www.hello-algo.com/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_appendix/</loc>
|
<loc>https://www.hello-algo.com/chapter_appendix/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_appendix/contribution/</loc>
|
<loc>https://www.hello-algo.com/chapter_appendix/contribution/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_appendix/installation/</loc>
|
<loc>https://www.hello-algo.com/chapter_appendix/installation/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_appendix/terminology/</loc>
|
<loc>https://www.hello-algo.com/chapter_appendix/terminology/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/</loc>
|
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/array/</loc>
|
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/array/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/linked_list/</loc>
|
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/linked_list/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/list/</loc>
|
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/list/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/ram_and_cache/</loc>
|
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/ram_and_cache/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/summary/</loc>
|
<loc>https://www.hello-algo.com/chapter_array_and_linkedlist/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_backtracking/</loc>
|
<loc>https://www.hello-algo.com/chapter_backtracking/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_backtracking/backtracking_algorithm/</loc>
|
<loc>https://www.hello-algo.com/chapter_backtracking/backtracking_algorithm/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_backtracking/n_queens_problem/</loc>
|
<loc>https://www.hello-algo.com/chapter_backtracking/n_queens_problem/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_backtracking/permutations_problem/</loc>
|
<loc>https://www.hello-algo.com/chapter_backtracking/permutations_problem/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_backtracking/subset_sum_problem/</loc>
|
<loc>https://www.hello-algo.com/chapter_backtracking/subset_sum_problem/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_backtracking/summary/</loc>
|
<loc>https://www.hello-algo.com/chapter_backtracking/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_computational_complexity/</loc>
|
<loc>https://www.hello-algo.com/chapter_computational_complexity/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_computational_complexity/iteration_and_recursion/</loc>
|
<loc>https://www.hello-algo.com/chapter_computational_complexity/iteration_and_recursion/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_computational_complexity/performance_evaluation/</loc>
|
<loc>https://www.hello-algo.com/chapter_computational_complexity/performance_evaluation/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_computational_complexity/space_complexity/</loc>
|
<loc>https://www.hello-algo.com/chapter_computational_complexity/space_complexity/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_computational_complexity/summary/</loc>
|
<loc>https://www.hello-algo.com/chapter_computational_complexity/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_computational_complexity/time_complexity/</loc>
|
<loc>https://www.hello-algo.com/chapter_computational_complexity/time_complexity/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_data_structure/</loc>
|
<loc>https://www.hello-algo.com/chapter_data_structure/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_data_structure/basic_data_types/</loc>
|
<loc>https://www.hello-algo.com/chapter_data_structure/basic_data_types/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_data_structure/character_encoding/</loc>
|
<loc>https://www.hello-algo.com/chapter_data_structure/character_encoding/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_data_structure/classification_of_data_structure/</loc>
|
<loc>https://www.hello-algo.com/chapter_data_structure/classification_of_data_structure/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_data_structure/number_encoding/</loc>
|
<loc>https://www.hello-algo.com/chapter_data_structure/number_encoding/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_data_structure/summary/</loc>
|
<loc>https://www.hello-algo.com/chapter_data_structure/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_divide_and_conquer/</loc>
|
<loc>https://www.hello-algo.com/chapter_divide_and_conquer/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_divide_and_conquer/binary_search_recur/</loc>
|
<loc>https://www.hello-algo.com/chapter_divide_and_conquer/binary_search_recur/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_divide_and_conquer/build_binary_tree_problem/</loc>
|
<loc>https://www.hello-algo.com/chapter_divide_and_conquer/build_binary_tree_problem/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_divide_and_conquer/divide_and_conquer/</loc>
|
<loc>https://www.hello-algo.com/chapter_divide_and_conquer/divide_and_conquer/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_divide_and_conquer/hanota_problem/</loc>
|
<loc>https://www.hello-algo.com/chapter_divide_and_conquer/hanota_problem/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_divide_and_conquer/summary/</loc>
|
<loc>https://www.hello-algo.com/chapter_divide_and_conquer/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_dynamic_programming/</loc>
|
<loc>https://www.hello-algo.com/chapter_dynamic_programming/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_dynamic_programming/dp_problem_features/</loc>
|
<loc>https://www.hello-algo.com/chapter_dynamic_programming/dp_problem_features/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_dynamic_programming/dp_solution_pipeline/</loc>
|
<loc>https://www.hello-algo.com/chapter_dynamic_programming/dp_solution_pipeline/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_dynamic_programming/edit_distance_problem/</loc>
|
<loc>https://www.hello-algo.com/chapter_dynamic_programming/edit_distance_problem/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_dynamic_programming/intro_to_dynamic_programming/</loc>
|
<loc>https://www.hello-algo.com/chapter_dynamic_programming/intro_to_dynamic_programming/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_dynamic_programming/knapsack_problem/</loc>
|
<loc>https://www.hello-algo.com/chapter_dynamic_programming/knapsack_problem/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_dynamic_programming/summary/</loc>
|
<loc>https://www.hello-algo.com/chapter_dynamic_programming/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_dynamic_programming/unbounded_knapsack_problem/</loc>
|
<loc>https://www.hello-algo.com/chapter_dynamic_programming/unbounded_knapsack_problem/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_graph/</loc>
|
<loc>https://www.hello-algo.com/chapter_graph/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_graph/graph/</loc>
|
<loc>https://www.hello-algo.com/chapter_graph/graph/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_graph/graph_operations/</loc>
|
<loc>https://www.hello-algo.com/chapter_graph/graph_operations/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_graph/graph_traversal/</loc>
|
<loc>https://www.hello-algo.com/chapter_graph/graph_traversal/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_graph/summary/</loc>
|
<loc>https://www.hello-algo.com/chapter_graph/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_greedy/</loc>
|
<loc>https://www.hello-algo.com/chapter_greedy/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_greedy/fractional_knapsack_problem/</loc>
|
<loc>https://www.hello-algo.com/chapter_greedy/fractional_knapsack_problem/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_greedy/greedy_algorithm/</loc>
|
<loc>https://www.hello-algo.com/chapter_greedy/greedy_algorithm/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_greedy/max_capacity_problem/</loc>
|
<loc>https://www.hello-algo.com/chapter_greedy/max_capacity_problem/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_greedy/max_product_cutting_problem/</loc>
|
<loc>https://www.hello-algo.com/chapter_greedy/max_product_cutting_problem/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_greedy/summary/</loc>
|
<loc>https://www.hello-algo.com/chapter_greedy/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_hashing/</loc>
|
<loc>https://www.hello-algo.com/chapter_hashing/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_hashing/hash_algorithm/</loc>
|
<loc>https://www.hello-algo.com/chapter_hashing/hash_algorithm/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_hashing/hash_collision/</loc>
|
<loc>https://www.hello-algo.com/chapter_hashing/hash_collision/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_hashing/hash_map/</loc>
|
<loc>https://www.hello-algo.com/chapter_hashing/hash_map/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_hashing/summary/</loc>
|
<loc>https://www.hello-algo.com/chapter_hashing/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_heap/</loc>
|
<loc>https://www.hello-algo.com/chapter_heap/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_heap/build_heap/</loc>
|
<loc>https://www.hello-algo.com/chapter_heap/build_heap/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_heap/heap/</loc>
|
<loc>https://www.hello-algo.com/chapter_heap/heap/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_heap/summary/</loc>
|
<loc>https://www.hello-algo.com/chapter_heap/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_heap/top_k/</loc>
|
<loc>https://www.hello-algo.com/chapter_heap/top_k/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_introduction/</loc>
|
<loc>https://www.hello-algo.com/chapter_introduction/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_introduction/algorithms_are_everywhere/</loc>
|
<loc>https://www.hello-algo.com/chapter_introduction/algorithms_are_everywhere/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_introduction/summary/</loc>
|
<loc>https://www.hello-algo.com/chapter_introduction/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_introduction/what_is_dsa/</loc>
|
<loc>https://www.hello-algo.com/chapter_introduction/what_is_dsa/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_paperbook/</loc>
|
<loc>https://www.hello-algo.com/chapter_paperbook/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_preface/</loc>
|
<loc>https://www.hello-algo.com/chapter_preface/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_preface/about_the_book/</loc>
|
<loc>https://www.hello-algo.com/chapter_preface/about_the_book/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_preface/suggestions/</loc>
|
<loc>https://www.hello-algo.com/chapter_preface/suggestions/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_preface/summary/</loc>
|
<loc>https://www.hello-algo.com/chapter_preface/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_reference/</loc>
|
<loc>https://www.hello-algo.com/chapter_reference/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_searching/</loc>
|
<loc>https://www.hello-algo.com/chapter_searching/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_searching/binary_search/</loc>
|
<loc>https://www.hello-algo.com/chapter_searching/binary_search/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_searching/binary_search_edge/</loc>
|
<loc>https://www.hello-algo.com/chapter_searching/binary_search_edge/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_searching/binary_search_insertion/</loc>
|
<loc>https://www.hello-algo.com/chapter_searching/binary_search_insertion/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_searching/replace_linear_by_hashing/</loc>
|
<loc>https://www.hello-algo.com/chapter_searching/replace_linear_by_hashing/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_searching/searching_algorithm_revisited/</loc>
|
<loc>https://www.hello-algo.com/chapter_searching/searching_algorithm_revisited/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_searching/summary/</loc>
|
<loc>https://www.hello-algo.com/chapter_searching/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_sorting/</loc>
|
<loc>https://www.hello-algo.com/chapter_sorting/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_sorting/bubble_sort/</loc>
|
<loc>https://www.hello-algo.com/chapter_sorting/bubble_sort/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_sorting/bucket_sort/</loc>
|
<loc>https://www.hello-algo.com/chapter_sorting/bucket_sort/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_sorting/counting_sort/</loc>
|
<loc>https://www.hello-algo.com/chapter_sorting/counting_sort/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_sorting/heap_sort/</loc>
|
<loc>https://www.hello-algo.com/chapter_sorting/heap_sort/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_sorting/insertion_sort/</loc>
|
<loc>https://www.hello-algo.com/chapter_sorting/insertion_sort/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_sorting/merge_sort/</loc>
|
<loc>https://www.hello-algo.com/chapter_sorting/merge_sort/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_sorting/quick_sort/</loc>
|
<loc>https://www.hello-algo.com/chapter_sorting/quick_sort/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_sorting/radix_sort/</loc>
|
<loc>https://www.hello-algo.com/chapter_sorting/radix_sort/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_sorting/selection_sort/</loc>
|
<loc>https://www.hello-algo.com/chapter_sorting/selection_sort/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_sorting/sorting_algorithm/</loc>
|
<loc>https://www.hello-algo.com/chapter_sorting/sorting_algorithm/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_sorting/summary/</loc>
|
<loc>https://www.hello-algo.com/chapter_sorting/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_stack_and_queue/</loc>
|
<loc>https://www.hello-algo.com/chapter_stack_and_queue/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_stack_and_queue/deque/</loc>
|
<loc>https://www.hello-algo.com/chapter_stack_and_queue/deque/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_stack_and_queue/queue/</loc>
|
<loc>https://www.hello-algo.com/chapter_stack_and_queue/queue/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_stack_and_queue/stack/</loc>
|
<loc>https://www.hello-algo.com/chapter_stack_and_queue/stack/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_stack_and_queue/summary/</loc>
|
<loc>https://www.hello-algo.com/chapter_stack_and_queue/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_tree/</loc>
|
<loc>https://www.hello-algo.com/chapter_tree/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_tree/array_representation_of_tree/</loc>
|
<loc>https://www.hello-algo.com/chapter_tree/array_representation_of_tree/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_tree/avl_tree/</loc>
|
<loc>https://www.hello-algo.com/chapter_tree/avl_tree/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_tree/binary_search_tree/</loc>
|
<loc>https://www.hello-algo.com/chapter_tree/binary_search_tree/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_tree/binary_tree/</loc>
|
<loc>https://www.hello-algo.com/chapter_tree/binary_tree/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_tree/binary_tree_traversal/</loc>
|
<loc>https://www.hello-algo.com/chapter_tree/binary_tree_traversal/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://www.hello-algo.com/chapter_tree/summary/</loc>
|
<loc>https://www.hello-algo.com/chapter_tree/summary/</loc>
|
||||||
<lastmod>2024-03-17</lastmod>
|
<lastmod>2024-03-19</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
</urlset>
|
</urlset>
|
BIN
sitemap.xml.gz
BIN
sitemap.xml.gz
Binary file not shown.
Loading…
Reference in a new issue