Skip to content

Commit 781efa2

Browse files
邵联飞邵联飞
authored andcommitted
第一周的作业
1 parent 10455eb commit 781efa2

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

Week01/first.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2+
//题目:旋转数组
3+
4+
15
//1.暴力法思路(目前我的解题思路只有这种):数组向右移动,每移动一次,最后位置的元素都放到0位置上,因此,此算法的时间复杂度为O(n*k);空间复杂度为O(1)符合题干
26
class Solution {
37
public void rotate(int[] nums, int k) {

Week01/second.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2+
//题目: 删除排序数组中的重复项
3+
4+
5+
16
//暴力方法(方法可行,但是不满足题干):1.使用两个数组,一个数组是原来的数组,一个是新的数组
27
//双指针法:(快慢指针)
38

0 commit comments

Comments
 (0)