Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
XPoet committed Apr 16, 2024
0 parents commit ab12a7c
Show file tree
Hide file tree
Showing 122 changed files with 7,838 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: deploy

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js v18.x
uses: actions/setup-node@v1
with:
node-version: "18.x"

- name: Install
run: npm install

- name: Build
run: npm run build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./dist
publish_branch: gh-pages
github_token: ${{ secrets.GH_PAGES_DEPLOY }}
user_name: ${{ secrets.MY_USER_NAME }}
user_email: ${{ secrets.MY_USER_EMAIL }}
commit_message: deploy docs site
51 changes: 51 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/src/.vitepress/dist
/src/.vitepress/cache
dist
dist-ssr
/tmp
/out-tsc

# dependencies
node_modules
yarn.lock
package-lock.json

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
# !.vscode/settings.json
# !.vscode/tasks.json
# !.vscode/launch.json
# !.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
testem.log
/typings

# e2e
/e2e/src/*.js
/e2e/src/*.map
/cypress/screenshots

# System Files
.DS_Store
Thumbs.db

# Other
*.local
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# JavaScript 数据结构与算法

本仓库的文档根据哔哩哔哩[《JavaScript 数据结构与算法》](https://www.bilibili.com/video/BV1x7411L7Q7)视频内容整理而成的学习笔记,视频教程讲得特别好,配合本仓库的文档和测试代码,学习效果更佳。

推荐大家按照目录结构的顺序来学习,由浅入深,循序渐进,轻松搞定数据结构和算法。

## 数据结构

- 数组
-
- 队列
- 优先队列
- 单向链表
- 双向链表
- 集合
- 字典
- 哈希表
-
- 二叉树
- 二叉搜索树
-

## 算法

- 排序算法
- 搜索算法
- 算法设计思想
- 经典算法题

## 测试代码

数据结构的测试代码存放在 `src/docs/public/data-structure` 目录下。

29 changes: 29 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "js-data-structure-and-algorithm",
"version": "0.0.1",
"description": "JavaScript 数据结构与算法",
"author": "XPoet <[email protected]>",
"main": "index.js",
"scripts": {
"dev": "vitepress dev src --open",
"preview": "vitepress preview src",
"build": "vitepress build src"
},
"repository": {
"type": "git",
"url": "git+https://github.com/XPoet/js-data-structure-and-algorithm.git"
},
"keywords": [
"javascript",
"data-structure",
"algorithm"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/XPoet/js-data-structure-and-algorithm/issues"
},
"homepage": "https://github.com/XPoet/js-data-structure-and-algorithm#readme",
"devDependencies": {
"vitepress": "^1.1.0"
}
}
87 changes: 87 additions & 0 deletions src/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "数据结构与算法",

description: "JavaScript 数据结构与算法",

lang: 'zh-CN',

lastUpdated: true,

srcDir: 'docs',

outDir:'../dist',

head: [
['link', { rel: 'icon', href: '/images/logo.png' }],
],

markdown: {
lineNumbers: true, // 代码行号
image: {
lazyLoading: true // 图片懒加载
}
},

// https://vitepress.dev/reference/default-theme-config
themeConfig: {
logo: '/images/logo.png',

outline: {
level: [2, 4]
},

search: {
provider: 'local'
},

nav: [
{ text: '数据结构', link: '/data-structure/Array', activeMatch: '/data-structure/' },
{ text: '算法', link: '/algorithm/sort', activeMatch: '/algorithm/' }
],

sidebar: {
// 数据结构
'/data-structure/': {
items: [
{ text: '数组', link: '/data-structure/Array' },
{ text: '栈', link: '/data-structure/Stack' },
{ text: '队列', link: '/data-structure/Queue' },
{ text: '优先队列', link: '/data-structure/PriorityQueue' },
{ text: '单向链表', link: '/data-structure/LinkedList' },
{ text: '双向链表', link: '/data-structure/DoubleLinkedList' },
{ text: '集合', link: '/data-structure/Set' },
{ text: '字典', link: '/data-structure/Map' },
{ text: '哈希表', link: '/data-structure/HashTable' },
{ text: '树', link: '/data-structure/Tree' },
{ text: '二叉树', link: '/data-structure/BinaryTree' },
{ text: '二叉搜索树', link: '/data-structure/BinarySearchTree' },
{ text: '图', link: '/data-structure/Graph' },
]
},

// 算法
'/algorithm/': {
text: '算法',
collapsed: false,
items: [
{ text: '排序', link: '/algorithm/sort' },
{ text: '搜索', link: '/algorithm/search' },
{ text: '设计思想', link: '/algorithm/idea' },
{ text: '经典算法', link: '/algorithm/classic' },
]
},
},

socialLinks: [
{ icon: 'github', link: 'https://github.com/XPoet/js-data-structure-and-algorithm' }
],

footer: {
message: 'Released under the AGPL-3.0 License',
copyright: 'Copyright © 2019-present XPoet'
},
}
})
Loading

0 comments on commit ab12a7c

Please sign in to comment.