LeetCode，《剑指offer》中的算法题的题目和解法以及常见算法的实现
![](res/header.png)



![](https://img.shields.io/badge/language-C%2B%2B-F14E7E.svg) 
![](https://img.shields.io/badge/language-Java-B07319.svg)
![](https://img.shields.io/badge/language-Swift-ffac45.svg)
 ![](https://img.shields.io/badge/judgement-passing-brightgreen.svg)


# Introduction

LeetCode &《剑指offer》中的算法题的题目和解法 & 常见算法的实现


# Chapters

## 1. Math  Implementation Questions（数学实现题）



[1.1 Fibonacci Implementation（斐波那契数列实现）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B1%5D.%20Math%20Implementation/1.1%20Fibonacci%20Implementation)

[1.2 Binary Search（二分查找）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B1%5D.%20Math%20Implementation/1.2%20Binary%20Search)

[1.3 Is Prime（是否是质数）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B1%5D.%20Math%20Implementation/1.3%20Is%20Prime)

[1.4 Is Ugly Number（是否是丑数）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B1%5D.%20Math%20Implementation/1.4%20Is%20Ugly%20Number)

[1.5 Is Power Of Two（是否是2的幂）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B1%5D.%20Math%20Implementation/1.5%20Is%20Power%20Of%20Two)

[1.6 Is Power Of Three（是否是3的幂）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B1%5D.%20Math%20Implementation/1.6%20Is%20Power%20Of%20Three)

[1.7 Count Primes（质数的个数）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B1%5D.%20Math%20Implementation/1.7%20Count%20Primes)





## 2. Algorithm Implementation Questions (算法实现题)

[2.0 Sort Test Demo（排序测试用例）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B2%5D.%20Algorithm%20Implementation/2.0%20Sort%20Test%20Demo)

[2.1 Bubble Sort Implementation（冒泡排序实现）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B2%5D.%20Algorithm%20Implementation/2.1%20Bubble%20Sort%20Implementation)

[2.2 Selection Sort Implementation（选择排序实现）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B2%5D.%20Algorithm%20Implementation/2.2%20Selection%20Sort%20Implementation)

[2.3 Insertion Sort Implementation（插入排序实现）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B2%5D.%20Algorithm%20Implementation/2.3%20Insertion%20Sort%20Implementation)

[2.4 Quick Sort Implementation（快速排序实现）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B2%5D.%20Algorithm%20Implementation/2.4%20Quick%20Sort%20Implementation)





## 3. Linked List Questions（链表相关问题）

[3.0 Linked List Test Demo（链表类，测试用例）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.0%20Linked%20List%20Test%20Demo)

[3.1 Linked List Cycle（链表是否有环）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.1%20Linked%20List%20Cycle)

[3.2 Intersection Of Two Linked Lists（两个链表的交点）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.2%20Intersection%20Of%20Two%20Linked%20Lists)

 [3.3 Reverse Linked List（反转链表）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.3%20Reverse%20Linked%20List)

[3.4 Merge Two Linked Lists（合并两个链表）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.4%20Merge%20Two%20Linked%20Lists)

[3.5 Find the Kth to tail in Linked List（找到链表的倒数第K个节点）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.5%20Find%20the%20Kth%20to%20tail%20in%20Linked%20List)

[3.6 Recursively Print Linked List（倒序打印链表）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.6%20Recursively%20Print%20Linked%20List%20)

[3.7 Remove Nth From End Of Linkded List（删除链表倒数第N个节点）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.7%20Remove%20Nth%20From%20End%20Of%20Linkded%20List)

[3.8 Delete Node in a Linked List（删除链表里某个节点）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.8%20Delete%20Node%20in%20a%20Linked%20List/)

[3.9 Remove Duplicates I（删除链表内重复的节点，保留单个节点）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.9%20Remove%20Duplicates%20I)

[3.10 Remove Duplicates II（删除链表内所有重复的节点）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.10%20Remove%20Duplicates%20II)

[3.11 Remove Linked List Elements（删除链表里某个值的所有节点）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.11%20Remove%20Linked%20List%20Elements)

[3.12 Partition Linked List（左右临界值分离）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.12%20Partition%20Linked%20List)

[3.13 Old Even List（左右奇偶index的值分离）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.13%20Old%20Evem%20List)



## 4. Array Questions（数组相关问题）

[4.0 Array Test Demo](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.0%20Array%20Test%20demo)

[4.1 Contains Duplicate I（检测数组中是否包含重复的元素）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.1%20Contains%20Duplicate%20I)

[4.2 Majority Element（出现次数超过数组长度一半的元素）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.2%20Majority%20Element)

[4.3 Single Number（数组中只出现过一次的数字）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.3%20Single%20Number)

[4.4 Missing Number (寻找数组中缺失的数字)](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.4%20Missing%20Number)

[4.5 Move Zeros (将所有的0移动到数组末尾)](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.5%20Move%20Zeros)

[4.6 Remove Element (移除数组中等于某个值的元素)](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.6%20Remove%20Element)

[4.7 Sort Colors（三色旗问题）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.7%20Sort%20Colors)

[4.8 Two Sum II（有序数组内部的两个元素的和为目标值）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.8%20Two%20Sum%20II)

[4.9 Minimum Sub Array Sum（无序数组和大于或等于某值的最小子数组）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.9%20Minimum%20Sub%20Array%20Sum)

[4.10 Intersection of Two Arrays（两个数组的交点元素）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.10%20Intersection%20of%20Two%20Arrays)

[4.11 The Top Kth Frequent Element  (出现频率最高的第k个元素)](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.11%20The%20Top%20Kth%20Frequent%20Element )

[4.12 The Kth Largest Element(数组中第k大的元素)](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.12%20The%20Kth%20Largest%20Element)

[4.13 Merge Two Sorted Array (合并两个有序的数组)](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.13%20Merge%20Two%20Sorted%20Array)

[4.14 Two Sum I（无序数组内部的两个元素的和为目标值）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.14%20Two%20Sum%20I)





## 5. Binary Tree Questions（二叉树相关问题）



[5.1 Maximum Depth of Binary Tree（二叉树的深度）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B5%5D.%20Tree/5.1%20Maximum%20Depth%20Of%20Binary%20Tree)

[5.2 Invert Binary Tree（反转二叉树）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B5%5D.%20Tree/5.2%20Invert%20Binary%20Tree)

[5.3 Balanced Binary Tree（是否是平衡二叉树）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B5%5D.%20Tree/5.3%20Balanced%20Binary%20Tree)

[5.4 Symmetric Tree（是否是镜像树）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B5%5D.%20Tree/5.4%20Symmetric%20Tree)

[5.5 Is Same Tree（树是否相等）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B5%5D.%20Tree/5.5%20Is%20Same%20Tree)





## 6. String Questions（字符串相关问题）

[6.1 Reverse String（反转字符串）](<https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B6%5D.%20String/6.1%20Reverse%20String>)











# License

This repositorie is released under the under [MIT License](https://github.com/knightsj/awesome-algorithm-question-solution/blob/master/LICENSE)

