<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"><channel><title>MagicLen</title><link>https://magiclen.org/cn/2019/05/</link><description>多元化原创文章，内容包罗万象，有编程语言、网站应用、软件介绍、硬件介绍、操作系统、旅行游记、专题采访、益智问题、文学创作，以及作者们的知识分享和作品分享。</description><language>zh-CN</language><lastBuildDate>Sun, 22 Nov 2026 23:31:10 +0800</lastBuildDate><atom:link href="https://magiclen.org/cn/2019/05/feed/" rel="self" type="application/rss+xml"/><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>8</sy:updateFrequency><sy:updateBase>1970-01-01T00:00+00:00</sy:updateBase><item><title>基数排序(Radix Sort)算法，可以依据多个键值来排序的算法</title><link>https://magiclen.org/cn/radix-sort/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2016/05/1463382782_icon_23_one_finger_double_tap-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2016/05/1463382782_icon_23_one_finger_double_tap-220x162.png 1x, https://magiclen.org/wp-content/uploads/2016/05/1463382782_icon_23_one_finger_double_tap-440x324.png 2x, https://magiclen.org/wp-content/uploads/2016/05/1463382782_icon_23_one_finger_double_tap-660x486.png 3x" alt>
基数排序(Radix Sort)算法是可以利用多个键值来排序数据的算法。排序还需要多个键值？有时候当然会需要啦！像是要排序文件时，可以先依照文件名称排序后，再依照文件大小来排，如此一来，整体上来看这些文件，会是以文件大小来排序，而相同文件大小的文件则是会依照文件名称来排序。基数排序法可以将整数的各个位数当作是键值，来进行线性时间的排序，比起会依照 k（要排序的数据可能的值的数量）愈大而愈吃空间的计...]]></description><category>研究分享</category><category>Go</category><category>Java</category><category>Rust</category><category>算法</category><category>JavaScript</category><category>Java</category><category>JavaScript</category><category>排序算法</category><category>Rust</category><category>基数排序</category><category>TypeScript</category><category>Go</category><guid>https://magiclen.org/cn/radix-sort</guid><pubDate>Thu, 30 May 2019 20:00:25 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>桶排序(Bucket Sort)算法，利用表达式将数据分类、排序后，再合并起来的排序算法</title><link>https://magiclen.org/cn/bucket-sort/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2016/05/1463382782_icon_23_one_finger_double_tap-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2016/05/1463382782_icon_23_one_finger_double_tap-220x162.png 1x, https://magiclen.org/wp-content/uploads/2016/05/1463382782_icon_23_one_finger_double_tap-440x324.png 2x, https://magiclen.org/wp-content/uploads/2016/05/1463382782_icon_23_one_finger_double_tap-660x486.png 3x" alt>
桶排序(Bucket Sort)算法是先将大量数据分类成少量数据后，再进行排序的算法。可以透过简单的表达式来完成数据的分类，在最好的情况之下，数据可以被完全打散，此时的时间复杂度就会是一个线性时间。]]></description><category>研究分享</category><category>Go</category><category>Java</category><category>Rust</category><category>算法</category><category>JavaScript</category><category>Java</category><category>JavaScript</category><category>排序算法</category><category>Rust</category><category>桶排序</category><category>TypeScript</category><category>Go</category><guid>https://magiclen.org/cn/bucket-sort</guid><pubDate>Sun, 26 May 2019 12:00:30 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>写程序的基本功：搜索算法(Search Algorithm)</title><link>https://magiclen.org/cn/search-algorithm/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-220x162.png 1x, https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-440x324.png 2x, https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-660x486.png 3x" alt>
这里所称的搜索(Search)，是指在一个已排序好或是尚未排序好的集合中，将指定元素的键值(key)或是索引值(index)搜索出来，或者是给定某个条件，在集合中搜索出符合该条件的数据。在集合内搜索元素的方法当然不会只有一种，而不同方法搜索数据的难易度、速度和其它特性自然也会有所不同。搜索算法(Search Algorithm)就是搜索数据的方法，目前已知的方法有很多，在这篇文章中将会整理本站所介...]]></description><category>研究分享</category><category>算法</category><category>字符串搜索</category><category>搜索算法</category><category>写程序的基本功</category><guid>https://magiclen.org/cn/search-algorithm</guid><pubDate>Wed, 22 May 2019 12:00:45 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>暴力字符串搜索(Brute-force Substring Search)算法，简单粗暴地在一个字符串中寻找子字符串</title><link>https://magiclen.org/cn/brute-force-substring-search/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-220x162.png 1x, https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-440x324.png 2x, https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-660x486.png 3x" alt>
暴力字符串搜索(Brute-force Substring Search)算法是最基本的字符串搜索算法。它可以按照原文中字符的顺序，逐一与搜索样本(pattern)进行比对，判断目前的搜索位置是否就是搜索样本存在的位置。]]></description><category>研究分享</category><category>Go</category><category>Java</category><category>Rust</category><category>算法</category><category>JavaScript</category><category>Java</category><category>JavaScript</category><category>字符串搜索</category><category>暴力字符串搜索</category><category>Rust</category><category>搜索算法</category><category>TypeScript</category><category>Go</category><guid>https://magiclen.org/cn/brute-force-substring-search</guid><pubDate>Mon, 20 May 2019 12:00:22 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>插补搜索(Interpolation Search)算法，运用数据近似线来辅助搜索的算法</title><link>https://magiclen.org/cn/interpolation-search/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-220x162.png 1x, https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-440x324.png 2x, https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-660x486.png 3x" alt>
插补搜索(Interpolation Search)算法又称为内插搜索算法，是二元搜索(Binary Search)算法的变体。这套算法可以在已排序好的串行中根据数据的预测线或近似线来进行高效率的搜索，近似线愈精准，搜索的效率就愈高。]]></description><category>研究分享</category><category>Go</category><category>Java</category><category>Rust</category><category>算法</category><category>JavaScript</category><category>Java</category><category>JavaScript</category><category>Rust</category><category>搜索算法</category><category>二元搜索</category><category>插补搜索</category><category>TypeScript</category><category>Go</category><guid>https://magiclen.org/cn/interpolation-search</guid><pubDate>Sat, 18 May 2019 12:00:32 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>指数搜索(Exponential Search)算法，搜索目标在串行愈前面就愈快的算法</title><link>https://magiclen.org/cn/exponential-search/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-220x162.png 1x, https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-440x324.png 2x, https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-660x486.png 3x" alt>
指数搜索(Exponential Search)算法又称为双倍搜索(Doubling Search)算法或是蔓延搜索(Galloping Search)算法，是二元搜索(Binary Search)算法的变体。这套算法可以在已排序好的串行中进行高效率的搜索，要搜索的元素在串行中愈前面的话，搜索性能愈好。]]></description><category>研究分享</category><category>Go</category><category>Java</category><category>Rust</category><category>算法</category><category>JavaScript</category><category>Java</category><category>JavaScript</category><category>Rust</category><category>搜索算法</category><category>二元搜索</category><category>指数搜索</category><category>TypeScript</category><category>Go</category><guid>https://magiclen.org/cn/exponential-search</guid><pubDate>Thu, 16 May 2019 12:00:42 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>二元搜索(Binary Search)算法，简单又快速的搜索算法</title><link>https://magiclen.org/cn/binary-search/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-220x162.png 1x, https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-440x324.png 2x, https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-660x486.png 3x" alt>
二元搜索(Binary Search)算法又称为二分搜索(Half-Interval Search)算法或是对数搜索(Logarithmic Search)算法，顾名思义，这套算法的核心思想就在于「二分」，可以在已排序好的串行中进行高效率的搜索。]]></description><category>研究分享</category><category>Go</category><category>Java</category><category>Rust</category><category>算法</category><category>JavaScript</category><category>Java</category><category>JavaScript</category><category>Rust</category><category>搜索算法</category><category>二元搜索</category><category>TypeScript</category><category>Go</category><guid>https://magiclen.org/cn/binary-search</guid><pubDate>Tue, 14 May 2019 12:00:35 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>线性搜索(Linear Search)算法，最基本的搜索算法</title><link>https://magiclen.org/cn/linear-search/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-220x162.png 1x, https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-440x324.png 2x, https://magiclen.org/wp-content/uploads/2016/04/Searchicons-search-blogs-512-660x486.png 3x" alt>
线性搜索(Linear Search)算法又称为循序搜索(Sequential Search)算法，是学习编程语言最先需要学会的搜索算法。它可以按照元素在数据结构中的顺序，从头开始进行走访，并连续判断目前走访到的元素是否是我们想要找的元素。]]></description><category>研究分享</category><category>Go</category><category>Java</category><category>Rust</category><category>算法</category><category>JavaScript</category><category>Java</category><category>JavaScript</category><category>Rust</category><category>搜索算法</category><category>线性搜索</category><category>TypeScript</category><category>Go</category><guid>https://magiclen.org/cn/linear-search</guid><pubDate>Sun, 12 May 2019 12:00:11 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>如何在 Rust 编程语言上使用类似 Java 的 Scanner 来读取文字符串流？</title><link>https://magiclen.org/cn/scanner-rust/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png 1x, https://magiclen.org/wp-content/uploads/2018/04/rust-440x324.png 2x, https://magiclen.org/wp-content/uploads/2018/04/rust-660x486.png 3x" alt>
Java 编程语言的 java.util.Scanner 是一个非常方便的类别，可以用来读取任意的字符串或是串流中的文字数据，它也是刚开始学习 Java 的人通常会第一个使用到的 java.util 套件中的类别。而 Rust 的标准函数库中并没有提供像是 Java 的 Scanner 这样方便好用的模块，大多就是用已经有实作好 Read 特性的结构实体所提供的 read、read_to_end、...]]></description><category>Rust</category><category>Rust</category><category>scanner-rust</category><guid>https://magiclen.org/cn/scanner-rust</guid><pubDate>Fri, 10 May 2019 12:00:30 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>Java 到底会把哪些字符当作是空白字符？</title><link>https://magiclen.org/cn/java-white-space/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2016/02/java-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2016/02/java-220x162.png 1x, https://magiclen.org/wp-content/uploads/2016/02/java-440x324.png 2x, https://magiclen.org/wp-content/uploads/2016/02/java-660x486.png 3x" alt>
Java 的 Character 类别提供了 isWhitespace 方法，可以用来判断指定的字符是否是空白字符，然而这边判断的空白字符并不单纯只是我们从键盘按下空白键所出现的「 」（字符值为 32），而是还包括 TAB 字符、换行字符等等会让文字在显示时被空白区域隔开的字符。正则表达式所使用的「javaWhitespace」样本(pattern)的空白字符判断标准与 Character.isW...]]></description><category>研究分享</category><category>Java</category><category>Java</category><guid>https://magiclen.org/cn/java-white-space</guid><pubDate>Wed, 8 May 2019 12:00:20 +0800</pubDate><dc:creator>Magic Len</dc:creator></item></channel></rss>