|
|
@@ -1,39 +1,86 @@
|
|
|
-# kxs
|
|
|
+Markdown 和快捷键全覆盖
|
|
|
+💡 Tips:语雀支持全功能 markdown 语法,可以点击文档编辑页右下角小键盘查看全部支持的语法和快捷键。
|
|
|
+● 支持导入导出 markdown 文件。
|
|
|
+● 支持自动识别粘贴的 markdown 格式内容转换为富文本。
|
|
|
+行内代码
|
|
|
+💡 Tips:可通过 markdown 语法(`+ code + ` + 空格)或者快捷键 ctrl/cmd + E快速插入行内代码。
|
|
|
+在文本中使用行内代码,可以顺畅地显示代码变量名。
|
|
|
+代码块
|
|
|
+💡 Tips:输入/代码块或点击上方工具栏点击上方工具栏,选择「代码块」、插入代码卡片。
|
|
|
+代码块同时支持多种颜色主题:
|
|
|
+export default class QuickSort extends Sort {
|
|
|
+ sort(originalArray) {
|
|
|
+ const array = [...originalArray];
|
|
|
|
|
|
-#### 介绍
|
|
|
-{**以下是 Gitee 平台说明,您可以替换此简介**
|
|
|
-Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台
|
|
|
-无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
|
|
|
+ if (array.length <= 1) {
|
|
|
+ return array;
|
|
|
+ }
|
|
|
|
|
|
-#### 软件架构
|
|
|
-软件架构说明
|
|
|
+ // Init left and right arrays.
|
|
|
+ const leftArray = [];
|
|
|
+ const rightArray = [];
|
|
|
|
|
|
+ // Take the first element of array as a pivot.
|
|
|
+ const pivotElement = array.shift();
|
|
|
+ const centerArray = [pivotElement];
|
|
|
|
|
|
-#### 安装教程
|
|
|
+ // Split all array elements between left, center and right arrays.
|
|
|
+ while (array.length) {
|
|
|
+ const currentElement = array.shift();
|
|
|
|
|
|
-1. xxxx
|
|
|
-2. xxxx
|
|
|
-3. xxxx
|
|
|
+ // Call visiting callback.
|
|
|
+ this.callbacks.visitingCallback(currentElement);
|
|
|
|
|
|
-#### 使用说明
|
|
|
+ if (this.comparator.equal(currentElement, pivotElement)) {
|
|
|
+ centerArray.push(currentElement);
|
|
|
+ } else if (this.comparator.lessThan(currentElement, pivotElement)) {
|
|
|
+ leftArray.push(currentElement);
|
|
|
+ } else {
|
|
|
+ rightArray.push(currentElement);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // Sort left and right arrays.
|
|
|
+ const leftArraySorted = this.sort(leftArray);
|
|
|
+ const rightArraySorted = this.sort(rightArray);
|
|
|
|
|
|
-1. xxxx d
|
|
|
-2. xxxx
|
|
|
-3. xxxx
|
|
|
+ return leftArraySorted.concat(centerArray, rightArraySorted);
|
|
|
+ }
|
|
|
+}
|
|
|
+export default class QuickSort extends Sort {
|
|
|
+ sort(originalArray) {
|
|
|
+ const array = [...originalArray];
|
|
|
|
|
|
-#### 参与贡献
|
|
|
+ if (array.length <= 1) {
|
|
|
+ return array;
|
|
|
+ }
|
|
|
|
|
|
-1. Fork 本仓库
|
|
|
-2. 新建 Feat_xxx 分支
|
|
|
-3. 提交代码
|
|
|
-4. 新建 Pull Request
|
|
|
+ // Init left and right arrays.
|
|
|
+ const leftArray = [];
|
|
|
+ const rightArray = [];
|
|
|
|
|
|
+ // Take the first element of array as a pivot.
|
|
|
+ const pivotElement = array.shift();
|
|
|
+ const centerArray = [pivotElement];
|
|
|
|
|
|
-#### 特技
|
|
|
+ // Split all array elements between left, center and right arrays.
|
|
|
+ while (array.length) {
|
|
|
+ const currentElement = array.shift();
|
|
|
|
|
|
-1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
|
|
|
-2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
|
|
|
-3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
|
|
|
-4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
|
|
|
-5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
|
|
|
-6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
|
|
+ // Call visiting callback.
|
|
|
+ this.callbacks.visitingCallback(currentElement);
|
|
|
+
|
|
|
+ if (this.comparator.equal(currentElement, pivotElement)) {
|
|
|
+ centerArray.push(currentElement);
|
|
|
+ } else if (this.comparator.lessThan(currentElement, pivotElement)) {
|
|
|
+ leftArray.push(currentElement);
|
|
|
+ } else {
|
|
|
+ rightArray.push(currentElement);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // Sort left and right arrays.
|
|
|
+ const leftArraySorted = this.sort(leftArray);
|
|
|
+ const rightArraySorted = this.sort(rightArray);
|
|
|
+
|
|
|
+ return leftArraySorted.concat(centerArray, rightArraySorted);
|
|
|
+ }
|
|
|
+}
|