1 Star 1 Fork 0

gitclebeg / EasyAlgorithm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

[TOC]

EasyAlgorithm

implement all data structure and algorithm by java, add use best way implement!
尝试用 Java 轻松掌握所有算法与数据结构,并且追求最高效的方式实现

一、数据结构(data structure)

package name: io.github.clebeg.model

1.1 数组表示树

二叉堆、优先队列、并查集 都是用数组表示的树型结构)

1.2 树基本表示

二叉查找树

1.3 图基本表示

图有两种基本的表示方法,邻接矩阵和邻接表 此处采用的是邻接表,但是也记录指向每个顶点的边 邻接表表示法:io.github.clebeg.algo.model.graph.ListGraph

  • 广度优先搜索: 具体见 ListGraph 的 bfs 方法
  • 深度优先搜索: 具体见 ListGraph 的 dfs 方法
  • 最小生成树Prim算法: 具体见 ListGraph 的 prim 方法
  • 最小生成树Kruskal算法: 具体见 ListGraph 的 kruskal 方法

二、算法

2.1 排序算法(sort algorithm)

算法效率:
7大基于比较的排序算法效率
package name: io.github.clebeg.algo.sort

实际测试:
io.github.clebeg.algo.sort.SortAlgoTest

io.github.clebeg.algo.sort.MergeSort
MergeSort{costTime=71(ms), swapTimes=0, compareTimes=1536633}
io.github.clebeg.algo.sort.QuickSort
QuickSort{costTime=49(ms), swapTimes=65113, compareTimes=2158939}
io.github.clebeg.algo.sort.InsertSort
InsertSort{costTime=8209(ms), swapTimes=0, compareTimes=-1796649581}
io.github.clebeg.algo.sort.ShellSort
ShellSort{costTime=53(ms), swapTimes=0, compareTimes=4400494}
io.github.clebeg.algo.sort.SelectSort
SelectSort{costTime=15995(ms), swapTimes=99999, compareTimes=704982704}
io.github.clebeg.algo.sort.BubbleSort
BubbleSort{costTime=49027(ms), swapTimes=-1796749567, compareTimes=704772374}
io.github.clebeg.algo.sort.HeapSort
HeapSort{costTime=30(ms), swapTimes=1574810, compareTimes=3019230}

已经实现的算法

MIT License Copyright (c) 2020 clebeg Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

用Java掌握所有算法与数据结构 展开 收起
Java
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/gitclebeg/EasyAlgorithm.git
git@gitee.com:gitclebeg/EasyAlgorithm.git
gitclebeg
EasyAlgorithm
EasyAlgorithm
master

搜索帮助