-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated By Github Actions With Build 182 of auto-generate-docsify-sid…
…ebar For Github Pages
- Loading branch information
0 parents
commit 07c3f0f
Showing
49 changed files
with
2,611 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# 00算法概述 | ||
|
||
|
||
个人算法题解答(Java版)仓库:https://github.com/givedrug/algorithm-exercise | ||
|
||
- 1数组Array | ||
- 2字符串String | ||
- 3链表Linked List | ||
- 4哈希表Hash Table | ||
- 5二分查找Binary Search | ||
- 6排序算法Sorting | ||
- 7树与二叉树Tree and Binary Tree | ||
- 8图Graph | ||
- 9滑动窗口Sliding Window | ||
- 10双指针Two Pointers | ||
- 11前缀和Prefix Sum | ||
- 12队列与栈Queue and Stack | ||
- 13递归Recursion | ||
- 14分治Divide and Conquer | ||
- 15贪心Greedy | ||
- 16动态规划Dynamic Programming | ||
- 17数学与位运算Math and Bit Manipulation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# 01数组 | ||
|
||
## 知识点 | ||
|
||
### 集合与列表 | ||
|
||
**集合**:由一个或多个确定的元素所构成的整体。集合可以没有元素,这样的集合叫做空集。 | ||
|
||
**列表**:是一种数据项构成的有限序列,即按照一定的线性顺序,排列而成的数据项的集合。 | ||
|
||
**数组**:列表的实现方式之一。 | ||
|
||
在内存中,数组是一块连续的区域。支持通过索引进行随机访问,但同时一次申请足够的存储空间也可能造成浪费。 | ||
|
||
难以处理增加和删除操作:需要调整一整块空间中的数据。 | ||
|
||
**链表**:列表的实现方式之一。 | ||
|
||
不要求内存连续,每一个数据都存有下一个数据的地址,通过指针相连。无法快速随机访问,但不会浪费连续空间。 | ||
|
||
适合处理增加与删除操作:只需要调整前后数据块的指针。 | ||
|
||
## 练习题目 | ||
|
||
**题目** | ||
- LeetCode 35. Search Insert Position 搜索插入位置 | ||
- LeetCode 48. Rotate Image 旋转图像 | ||
- LeetCode 56. Merge Intervals 合并区间 | ||
- LeetCode 485. Max Consecutive Ones 最大连续 1 的个数 | ||
- LeetCode 498. Diagonal Traverse 对角线遍历 | ||
- LeetCode 1991. Find the Middle Index in Array 找到数组的中间位置 | ||
- LeetCode 面试题 01.08. Zero Matrix LCCI 零矩阵 | ||
|
||
**思路** | ||
- LeetCode 35. | ||
> 二分查找 | ||
> | ||
> 复杂度:log(n) | ||
> | ||
- LeetCode 48. | ||
> 直接交换四分之一块(i,j)->(j,n-i) | ||
> | ||
> 复杂度:n^2 | ||
> | ||
- LeetCode 56. | ||
> 先排序,然后两两合并 | ||
> | ||
> 复杂度:n | ||
> | ||
- LeetCode 485. | ||
> 顺序遍历,记录连续1个数 | ||
> | ||
> 复杂度:n | ||
> | ||
- LeetCode 498. | ||
> 注意到,每次同一条对角线上的坐标(i,j)都有i+j为固定值,且下一条比上一条递增1(注意奇数行与偶数行要调换顺序) | ||
> | ||
> 复杂度:m\*n | ||
> | ||
- LeetCode 1991. | ||
> 先求和,然后遍历数组,同时对比左右子数组的和 | ||
> | ||
> 复杂度:n | ||
> | ||
- LeetCode 面试题 01.08. | ||
> 第一遍找出所有0元素的行号与列号,第二遍置零 | ||
> | ||
> 复杂度:m\*n | ||
> | ||
Oops, something went wrong.