计算机常用基础算法
Algorithms playground for common questions solved in Java syntax.
This repository contains my solution for some common algorithms. I’ve created this repository to learn about algorithms and improve solving different common computer science problems. I’ll try to add more solutions if I have time :)
Each solved problem has a program written in Java. Every solution is tested and some problems contains more than one solution with different implementations.
You can check the solution executing tests inside tests directory. Some of this problems have been resolved using TDD.
Problems
Arrays
- Clockwise print array - 順時針打印數組
Commons
- Hex conversion utility - 進制轉換工具
- Majority number - 大多數,超過一半的數
- Maximum product - 最大乘積
- TOPK algorithm - TOPK算法
Graph
- Dijkstra algorithm - 迪杰斯特拉算法
- [Directed graph depth first and breadth-first by adjacency table - 鄰接表實現有向圖深度優先和廣度優先]
(src%2Fmain%2Fjava%2Fcn%2Fcodepub%2Falgorithms%2Fgraph%2FDirectedGraphByAdjacencyList.java) - [Directed graph depth first and breadth-first by adjacency matrix - 鄰接矩陣實現有向圖深度優先和廣度優先]
(src%2Fmain%2Fjava%2Fcn%2Fcodepub%2Falgorithms%2Fgraph%2FDirectedGraphByAdjacencyMatrix.java) - Floyd warshall - 弗洛伊德算法
- Kruskal - 克魯斯卡爾算法
- Prim - 普里姆算法
- [Undirected graph depth first and breadth-first by adjacency table - 鄰接表實現無向圖深度優先和廣度優先]
(src%2Fmain%2Fjava%2Fcn%2Fcodepub%2Falgorithms%2Fgraph%2FUndirectedGraphByAdjacencyList.java) - [Undirected graph depth first and breadth-first by adjacency matrix - 鄰接矩陣實現無向圖深度優先和廣度優先]
(src%2Fmain%2Fjava%2Fcn%2Fcodepub%2Falgorithms%2Fgraph%2FUndirectedGraphByAdjacencyMatrix.java)
Matrix
- Matrix multiplication - 方陣乘法
Multithread
- Thread synchronization - 線程同步
Queue
- Simple priority queue - 簡單的優先級隊列
Similarity
- Words similarity by Tongyici CiLin - 基于同義詞詞林的詞語相似度
Sorting Algorithms
- Bubble sorting - 冒泡排序
- Insert sorting - 插入排序
- Quick sorting - 快速排序
- SelectionSort sorting - 選擇排序
- Shell sorting - 希爾排序
Chinese to Spelling
- Chinese to spelling - 中文轉拼音
Stack
- Analyzing brackets match - 判斷括號是否匹配
- Check stack sequence - 檢查棧的彈出序列
- Infix expression turn to postfix expression - 中綴表達式轉后綴表達式
- Maintain a minimum number of stacks - 保持最小數的棧
- Postfix expression evaluation - 后綴表達式求值
Strings
- Binary search - 二分查找
- Combination - 組合
- Jaccard similarity coefficient - 杰卡德相似度系數
- Longest common subsequence - 最長公共子序列
- Longest common substring 1 - 最長公共子串1
- Longest common substring 2 - 最長公共子串2
- Levenshtein distance - 編輯距離
- Longest decreasing subsequence - 最長遞減子序列
- Pattern string match - 模式串查找
- Permutation - 全排列
- Reverse string - 反轉字符串
- Lexicographical - 字典序排序
- Manacher algorithms - 最長回文字符串
Trees
- Depth-first traversal of a binary tree - 二叉樹的深度優先遍歷
- Get all path by given a number - 二叉樹中結點值的和為輸入整數的所有路徑
- Level binary tree traversal - 二叉樹的層次遍歷
- Binary tree traversal - 二叉樹的遍歷
- Verify sequence Of binary search tree - 驗證二叉搜索樹序列
Design Patterns
- Deep clone - 深拷貝
- Singleton - 單例
- Static proxy - 靜態代理
- JDK dynamic proxy - JDK實現動態代理
- CGLib dynamic proxy - CGLib實現動態代理
Author
- Developed By Xu Wang
- https://github.com/shijiebei2009/Algorithms
.
總結
- 上一篇: Java数据结构和算法:图
- 下一篇: Java数据结构和算法:线性表