Skip to content

Commit 1e7bfed

Browse files
committed
all
1 parent 0e00826 commit 1e7bfed

File tree

9 files changed

+147
-0
lines changed

9 files changed

+147
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.algorithm.leetcode.linkedList;
2+
3+
import com.algorithm.leetcode.commonEntity.ListNode;
4+
5+
/**
6+
* @author shenli
7+
* @date 2021/12/2
8+
*/
9+
public class ReverseList {
10+
11+
public ListNode reverseList(ListNode head) {
12+
ListNode prev = null;
13+
ListNode curr = head;
14+
while (curr != null) {
15+
ListNode next = curr.next;
16+
curr.next = prev;
17+
prev = curr;
18+
curr = next;
19+
}
20+
return prev;
21+
}
22+
23+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.algorithm.shoppe;
2+
3+
/**
4+
* @author shenli
5+
* @date 2021/12/3
6+
* 给你一个链表,每 k 个节点一组进行翻转,请你返回翻转后的链表。
7+
*
8+
* k 是一个正整数,它的值小于或等于链表的长度。
9+
*
10+
* 如果节点总数不是 k 的整数倍,那么请将最后剩余的节点保持原有顺序。
11+
*/
12+
public class ReverseKGroup {
13+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.algorithm.shoppe.easy;
2+
3+
import com.algorithm.leetcode.commonEntity.ListNode;
4+
5+
/**
6+
* @author shenli
7+
* @date 2021/12/3
8+
* 给你两个单链表的头节点 headA 和 headB ,请你找出并返回两个单链表相交的起始节点。如果两个链表不存在相交节点,返回 null
9+
*/
10+
public class GetIntersectionNode {
11+
public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
12+
13+
}
14+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.algorithm.shoppe.easy;
2+
3+
/**
4+
* @author shenli
5+
* @date 2021/12/3
6+
* 给你单链表的头节点 head ,请你反转链表,并返回反转后的链表。
7+
*/
8+
public class ReverseList {
9+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.algorithm.shoppe.hard;
2+
3+
/**
4+
* @author shenli
5+
* @date 2021/12/3
6+
* 给你一个整数数组 nums,有一个大小为 k 的滑动窗口从数组的最左侧移动到数组的最右侧。你只可以看到在滑动窗口内的 k 个数字。滑动窗口每次只向右移动一位。
7+
* <p>
8+
* 返回滑动窗口中的最大值。
9+
*/
10+
public class MaxSlidingWindow {
11+
12+
public int[] maxSlidingWindow(int[] nums, int k) {
13+
}
14+
15+
public static void main(String[] args) {
16+
int[] nums = new int[]{1, 3, -1, -3, 5, 3, 6, 7};
17+
int k = 3;
18+
}
19+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.algorithm.shoppe.hard;
2+
3+
/**
4+
* @author shenli
5+
* @date 2021/12/3
6+
* 给你一个字符串 s 、一个字符串 t 。返回 s 中涵盖 t 所有字符的最小子串。如果 s 中不存在涵盖 t 所有字符的子串,则返回空字符串 "" 。
7+
* 输入:s = "ADOBECODEBANC", t = "ABC"
8+
* 输出:"BANC"
9+
*/
10+
public class MinWindow {
11+
public String minWindow(String s, String t) {
12+
}
13+
14+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.algorithm.shoppe.medium;
2+
3+
import com.algorithm.leetcode.commonEntity.ListNode;
4+
5+
/**
6+
* @author shenli
7+
* @date 2021/12/3
8+
* 存在一个按升序排列的链表,给你这个链表的头节点 head ,请你删除链表中所有存在数字重复情况的节点,只保留原始链表中 没有重复出现 的数字。
9+
*
10+
* 返回同样按升序排列的结果链表。
11+
*/
12+
public class DeleteDuplicates {
13+
public ListNode deleteDuplicates(ListNode head) {
14+
}
15+
16+
public static void main(String[] args) {
17+
18+
}
19+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.algorithm.shoppe.medium;
2+
3+
/**
4+
* @author shenli
5+
* @date 2021/12/3
6+
*/
7+
public class LargestNumber {
8+
public String largestNumber(int[] nums) {
9+
10+
}
11+
12+
public static void main(String[] args) {
13+
int[] nums = new int[]{10, 2};
14+
String result = "210";
15+
int []nums1 = new int[]{3,30,34,5,9};
16+
String result1= "9534330";
17+
}
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.algorithm.shoppe.medium;
2+
3+
/**
4+
* @author shenli
5+
* @date 2021/12/3
6+
* 给定一个字符串 s ,请你找出其中不含有重复字符的 最长子串 的长度。
7+
*/
8+
public class LengthOfLongestSubstring {
9+
public int lengthOfLongestSubstring(String s) {
10+
11+
}
12+
13+
public static void main(String[] args) {
14+
String s = "abcabcbb";
15+
int result = 3;
16+
17+
}
18+
}

0 commit comments

Comments
 (0)