Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ab12a7c

Browse files
committed
init
0 parents commit ab12a7c

File tree

122 files changed

+7838
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+7838
-0
lines changed

‎.github/workflows/deploy.yml‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Setup Node.js v18.x
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: "18.x"
21+
22+
- name: Install
23+
run: npm install
24+
25+
- name: Build
26+
run: npm run build
27+
28+
- name: Deploy
29+
uses: peaceiris/actions-gh-pages@v3
30+
with:
31+
publish_dir: ./dist
32+
publish_branch: gh-pages
33+
github_token: ${{ secrets.GH_PAGES_DEPLOY }}
34+
user_name: ${{ secrets.MY_USER_NAME }}
35+
user_email: ${{ secrets.MY_USER_EMAIL }}
36+
commit_message: deploy docs site

‎.gitignore‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/src/.vitepress/dist
5+
/src/.vitepress/cache
6+
dist
7+
dist-ssr
8+
/tmp
9+
/out-tsc
10+
11+
# dependencies
12+
node_modules
13+
yarn.lock
14+
package-lock.json
15+
16+
# IDEs and editors
17+
/.idea
18+
.project
19+
.classpath
20+
.c9/
21+
*.launch
22+
.settings/
23+
*.sublime-workspace
24+
25+
# IDE - VSCode
26+
.vscode/*
27+
# !.vscode/settings.json
28+
# !.vscode/tasks.json
29+
# !.vscode/launch.json
30+
# !.vscode/extensions.json
31+
32+
# misc
33+
/.sass-cache
34+
/connect.lock
35+
/coverage
36+
/libpeerconnection.log
37+
npm-debug.log
38+
testem.log
39+
/typings
40+
41+
# e2e
42+
/e2e/src/*.js
43+
/e2e/src/*.map
44+
/cypress/screenshots
45+
46+
# System Files
47+
.DS_Store
48+
Thumbs.db
49+
50+
# Other
51+
*.local

‎README.md‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# JavaScript 数据结构与算法
2+
3+
本仓库的文档根据哔哩哔哩[《JavaScript 数据结构与算法》](https://www.bilibili.com/video/BV1x7411L7Q7)视频内容整理而成的学习笔记,视频教程讲得特别好,配合本仓库的文档和测试代码,学习效果更佳。
4+
5+
推荐大家按照目录结构的顺序来学习,由浅入深,循序渐进,轻松搞定数据结构和算法。
6+
7+
## 数据结构
8+
9+
- 数组
10+
-
11+
- 队列
12+
- 优先队列
13+
- 单向链表
14+
- 双向链表
15+
- 集合
16+
- 字典
17+
- 哈希表
18+
-
19+
- 二叉树
20+
- 二叉搜索树
21+
-
22+
23+
## 算法
24+
25+
- 排序算法
26+
- 搜索算法
27+
- 算法设计思想
28+
- 经典算法题
29+
30+
## 测试代码
31+
32+
数据结构的测试代码存放在 `src/docs/public/data-structure` 目录下。
33+

‎package.json‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "js-data-structure-and-algorithm",
3+
"version": "0.0.1",
4+
"description": "JavaScript 数据结构与算法",
5+
"author": "XPoet <i@xpoet.cn>",
6+
"main": "index.js",
7+
"scripts": {
8+
"dev": "vitepress dev src --open",
9+
"preview": "vitepress preview src",
10+
"build": "vitepress build src"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "git+https://github.com/XPoet/js-data-structure-and-algorithm.git"
15+
},
16+
"keywords": [
17+
"javascript",
18+
"data-structure",
19+
"algorithm"
20+
],
21+
"license": "MIT",
22+
"bugs": {
23+
"url": "https://github.com/XPoet/js-data-structure-and-algorithm/issues"
24+
},
25+
"homepage": "https://github.com/XPoet/js-data-structure-and-algorithm#readme",
26+
"devDependencies": {
27+
"vitepress": "^1.1.0"
28+
}
29+
}

‎src/.vitepress/config.mts‎

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
import { defineConfig } from 'vitepress'
2+
3+
// https://vitepress.dev/reference/site-config
4+
export default defineConfig({
5+
title: "数据结构与算法",
6+
7+
description: "JavaScript 数据结构与算法",
8+
9+
lang: 'zh-CN',
10+
11+
lastUpdated: true,
12+
13+
srcDir: 'docs',
14+
15+
outDir:'../dist',
16+
17+
head: [
18+
['link', { rel: 'icon', href: '/images/logo.png' }],
19+
],
20+
21+
markdown: {
22+
lineNumbers: true, // 代码行号
23+
image: {
24+
lazyLoading: true // 图片懒加载
25+
}
26+
},
27+
28+
// https://vitepress.dev/reference/default-theme-config
29+
themeConfig: {
30+
logo: '/images/logo.png',
31+
32+
outline: {
33+
level: [2, 4]
34+
},
35+
36+
search: {
37+
provider: 'local'
38+
},
39+
40+
nav: [
41+
{ text: '数据结构', link: '/data-structure/Array', activeMatch: '/data-structure/' },
42+
{ text: '算法', link: '/algorithm/sort', activeMatch: '/algorithm/' }
43+
],
44+
45+
sidebar: {
46+
// 数据结构
47+
'/data-structure/': {
48+
items: [
49+
{ text: '数组', link: '/data-structure/Array' },
50+
{ text: '栈', link: '/data-structure/Stack' },
51+
{ text: '队列', link: '/data-structure/Queue' },
52+
{ text: '优先队列', link: '/data-structure/PriorityQueue' },
53+
{ text: '单向链表', link: '/data-structure/LinkedList' },
54+
{ text: '双向链表', link: '/data-structure/DoubleLinkedList' },
55+
{ text: '集合', link: '/data-structure/Set' },
56+
{ text: '字典', link: '/data-structure/Map' },
57+
{ text: '哈希表', link: '/data-structure/HashTable' },
58+
{ text: '树', link: '/data-structure/Tree' },
59+
{ text: '二叉树', link: '/data-structure/BinaryTree' },
60+
{ text: '二叉搜索树', link: '/data-structure/BinarySearchTree' },
61+
{ text: '图', link: '/data-structure/Graph' },
62+
]
63+
},
64+
65+
// 算法
66+
'/algorithm/': {
67+
text: '算法',
68+
collapsed: false,
69+
items: [
70+
{ text: '排序', link: '/algorithm/sort' },
71+
{ text: '搜索', link: '/algorithm/search' },
72+
{ text: '设计思想', link: '/algorithm/idea' },
73+
{ text: '经典算法', link: '/algorithm/classic' },
74+
]
75+
},
76+
},
77+
78+
socialLinks: [
79+
{ icon: 'github', link: 'https://github.com/XPoet/js-data-structure-and-algorithm' }
80+
],
81+
82+
footer: {
83+
message: 'Released under the AGPL-3.0 License',
84+
copyright: 'Copyright © 2019-present XPoet'
85+
},
86+
}
87+
})

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /