{"id":15033304,"url":"https://github.com/hustcc/js-sorting-algorithm","last_synced_at":"2025-04-11T03:27:26.039Z","repository":{"id":37752454,"uuid":"79447433","full_name":"hustcc/JS-Sorting-Algorithm","owner":"hustcc","description":"一本关于排序算法的 GitBook 在线书籍 《十大经典排序算法》，多语言实现。","archived":false,"fork":false,"pushed_at":"2024-03-30T04:35:46.000Z","size":3636,"stargazers_count":5174,"open_issues_count":24,"forks_count":1149,"subscribers_count":148,"default_branch":"master","last_synced_at":"2025-04-03T16:07:50.935Z","etag":null,"topics":["algorithm","gitbook","golang","javascript","python","sorting-algorithms"],"latest_commit_sha":null,"homepage":"https://sort.hust.cc/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hustcc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://paypal.me/hustcc","https://atool.vip"]}},"created_at":"2017-01-19T11:36:21.000Z","updated_at":"2025-03-31T11:39:12.000Z","dependencies_parsed_at":"2024-06-18T17:22:01.708Z","dependency_job_id":null,"html_url":"https://github.com/hustcc/JS-Sorting-Algorithm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2FJS-Sorting-Algorithm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2FJS-Sorting-Algorithm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2FJS-Sorting-Algorithm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2FJS-Sorting-Algorithm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hustcc","download_url":"https://codeload.github.com/hustcc/JS-Sorting-Algorithm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248334995,"owners_count":21086487,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","gitbook","golang","javascript","python","sorting-algorithms"],"created_at":"2024-09-24T20:20:39.984Z","updated_at":"2025-04-11T03:27:26.020Z","avatar_url":"https://github.com/hustcc.png","language":"Java","readme":"# 十大经典排序算法\n\n[![Build Status](https://travis-ci.org/hustcc/JS-Sorting-Algorithm.svg?branch=master)](https://travis-ci.org/hustcc/JS-Sorting-Algorithm)\n\n排序算法是《数据结构与算法》中最基本的算法之一。\n\n排序算法可以分为内部排序和外部排序，内部排序是数据记录在内存中进行排序，而外部排序是因排序的数据很大，一次不能容纳全部的排序记录，在排序过程中需要访问外存。常见的内部排序算法有：**插入排序、希尔排序、选择排序、冒泡排序、归并排序、快速排序、堆排序、基数排序**等。用一张图概括：\n\n![十大经典排序算法 概览截图](res/sort.png)\n\n\n**关于时间复杂度**：\n\n1. 平方阶 (O(n2)) 排序\n\t各类简单排序：直接插入、直接选择和冒泡排序。\n2. 线性对数阶 (O(nlog2n)) 排序\n\t快速排序、堆排序和归并排序；\n3. O(n1+§)) 排序，§ 是介于 0 和 1 之间的常数。\n    希尔排序\n4. 线性阶 (O(n)) 排序\n\t基数排序，此外还有桶、箱排序。\n\n\n**关于稳定性**：\n\n稳定的排序算法：冒泡排序、插入排序、归并排序和基数排序。\n\n不是稳定的排序算法：选择排序、快速排序、希尔排序、堆排序。\n\n\n**名词解释**：\n\n**n**：数据规模\n\n**k**：“桶”的个数\n\n**In-place**：占用常数内存，不占用额外内存\n\n**Out-place**：占用额外内存\n\n**稳定性**：排序后 2 个相等键值的顺序和排序之前它们的顺序相同\n\n----\n\n\n**GitBook 内容大纲**\n\n1. [冒泡排序](1.bubbleSort.md)\n2. [选择排序](2.selectionSort.md)\n3. [插入排序](3.insertionSort.md)\n4. [希尔排序](4.shellSort.md)\n5. [归并排序](5.mergeSort.md)\n6. [快速排序](6.quickSort.md)\n7. [堆排序](7.heapSort.md)\n8. [计数排序](8.countingSort.md)\n9. [桶排序](9.bucketSort.md)\n10. [基数排序](10.radixSort.md)\n\n----\n\n本书内容几乎完全来源于网络。\n\n开源项目地址：[https://github.com/hustcc/JS-Sorting-Algorithm](https://github.com/hustcc/JS-Sorting-Algorithm)，整理人 [hustcc](https://github.com/hustcc)。\n\nGitBook 在线阅读地址：[https://sort.hust.cc/](https://sort.hust.cc/)。\n\n本项目使用 [lint-md](https://github.com/hustcc/lint-md) 进行中文 Markdown 文件的格式检查，务必在提交 Pr 之前，保证 Markdown 格式正确。\n","funding_links":["https://paypal.me/hustcc","https://atool.vip"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustcc%2Fjs-sorting-algorithm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhustcc%2Fjs-sorting-algorithm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustcc%2Fjs-sorting-algorithm/lists"}