This project is a collection of fully functional examples written in Java programming language, showing how to implement 14 typical algorithms && data Structures from sketch. It is created with ambition to make a short, complete and realistic DSA study guide for coding interviews as well as competitive programming.
- LinearSearch 线性查找
- SelectionSort 选择排序
- InsertionSort 插入排序
- QuickSort 快速排序
- Array
- Stack & Queue
- Stack (将增删操作限制为单侧,并且数据满足后入先出 LIFO)
- ARStack
- LLStack
- Queue (数据满足先入先出 FIFO)
- ARQueue
- LLQueue
- CircularQueue 循环队列
- PriorityQueue 优先队列
- LinkedList
- ListNode
- Recursion 递归构造
- MergeSort 归并排序
- QuickSort 快速排序
- BinarySearchTree 二分搜索树 (左子树中所有元素小于当前节点元素,右子树中所有元素大于当前节点元素)
- TreeNode
- Set&Map 集合与映射
- Heap 堆
LL | BST |
---|---|
E e Node next |
E e Node left Node right |
Node head int size |
Node root int size |
Set | Map |
---|---|
void add(E) void remove(E) boolean contains(E) int getSize() boolean isEmpty() |
void add(K, V) V remove(K) boolean contains(K) V get(K) void set(K,V) int getSize() boolean isEmpty() |
- ARStack
- LLStack (栈内元素数量不可预料,时大时小)
- Deque
- PriorityQueue
- BlockingQueue (ARBlockingQueue, LLBlockingQueue, PriorityBlockingQueue)
- ArrayList
- LinkedList
- Vector
HashSet SortedSet, TreeSet ConcurrentSkipListSet
HashMap TreeMap ConcurrentHashMap
# | Title | Code | Document | Video | Difficulty | Tag |
---|---|---|---|---|---|---|
1 | Absolute value | Theory | 🟩 Easy | abs() | ||
2 | Celsius To Fahrenheit | Theory | 🟩 Easy | Math | ||
3 | Roots of Quadratic equation | Theory | 🟩 Easy | Math | ||
4 | Factorial Of Number | 🟩 Easy | Math | |||
5 | Count digits in a factorial | 🟩 Easy | Factorial, Math | |||
6 | Series GP | 🟩 Easy | Basic Math | |||
7 | Prime Number | 🟩 Easy | Basic Math | |||
8 | Exactly 3 Divisors | Theory | 🟩 Easy | Basic Math | ||
9 | Addition Under Modulo | Theory | 🟩 Easy | Modulo | ||
10 | Multiplication Under Modulo | Theory | 🟩 Easy | Modulo | ||
11 | Modular Multiplicative Inverse | 🟩 Easy | Modulo | |||
12 | Trailing zeroes in factorial | 🟧 Medium | Logic | |||
13 | Prime Factors | 🟧 Medium | Prime |
出现频度为5:
- Leet Code OJ 1. Two Sum [Difficulty: Easy]
- Leet Code OJ 8. String to Integer (atoi) [Difficulty: Easy]
- Leet Code OJ 15. 3Sum [Difficulty: Medium]
- Leet Code OJ 20. Valid Parentheses [Difficulty: Easy]
- Leet Code OJ 21. Merge Two Sorted Lists [Difficulty: Easy]
- Leet Code OJ 28. Implement strStr() [Difficulty: Easy]
- Leet Code OJ 56. Merge Intervals [Difficulty: Hard]
- Leet Code OJ 57. Insert Interval [Difficulty: Hard]
- Leet Code OJ 65. Valid Number [Difficulty: Hard]
- Leet Code OJ 70. Climbing Stairs [Difficulty: Easy]
- Leet Code OJ 73. 链式结构.Set Matrix Zeroes [Difficulty: Medium]
- Leet Code OJ 88. Merge Sorted Array [Difficulty: Easy]
- Leet Code OJ 98. Validate Binary Search Tree [Difficulty: Medium]
- Leet Code OJ 125. Valid Palindrome [Difficulty: Easy]
- Leet Code OJ 127. Word Ladder [Difficulty: Medium]
出现频度为4:
- Leet Code OJ 2. Add Two Numbers [Difficulty: Medium]
- Leet Code OJ 12. Integer to Roman
- Leet Code OJ 13. Roman to Integer
- Leet Code OJ 22. Generate Parentheses
- Leet Code OJ 23. Merge k Sorted Lists
- Leet Code OJ 24. Swap Nodes in Pairs
- Leet Code OJ 27. Remove Element [Difficulty: Easy]
- Leet Code OJ 46. Permutations
- Leet Code OJ 49. Anagrams
- Leet Code OJ 67. Add Binary
- Leet Code OJ 69. Sqrt(x)
- Leet Code OJ 77. Combinations
- Leet Code OJ 78. Subsets
- Leet Code OJ 79. Word Search
- Leet Code OJ 91. Decode Ways [Difficulty: Medium]
- Leet Code OJ 102. Binary Tree Level Order Traversal [Difficulty: Easy]
- Leet Code OJ 129. Sum Root to Leaf Numbers
- Leet Code OJ 131. Palindrome Partitioning
- https://chasserush.github.io/DataStructureVisualizations/ LixiangZhao commit
LixiangZhao has been invited as a collaborator of this project.