自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(152)
  • 资源 (3)
  • 收藏
  • 关注

原创 优秀硕士毕业生发言稿

发言稿

2022-06-24 16:46:41 296 1

原创 java刷题--94二叉树的中序遍历

java刷题--94二叉树的中序遍历题目代码结果题目代码class Solution { public List<Integer> inorderTraversal(TreeNode root) { LinkedList<Integer> res = new LinkedList(); Stack<TreeNode> stack = new Stack(); while(root != null || !st

2021-09-19 00:22:35 199

原创 剑指offer--69 II 二叉树的最近公共祖先

剑指offer--69 II 二叉树的最近公共祖先题目代码结果题目代码class Solution { public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) { if (root == null) return null; if (root == p || root == q) return root; //两个递归返回的是root!

2021-08-02 00:20:08 172

原创 java刷题--433最小基因变化

java刷题--433最小基因变化题目代码结果题目代码class Solution { public int minMutation(String start, String end, String[] bank) { HashSet<String> set = new HashSet<>(); for(String b:bank) set.add(b); //把bank中的字符都存到set if(!set.conta

2021-07-31 23:27:13 195

原创 java刷题--190颠倒二进制位

java刷题--190颠倒二进制位题目代码结果题目代码public class Solution { public int reverseBits(int n) { int rev = 0; for (int i = 0; i < 32 && n != 0; i++) { rev |= (n & 1) << (31 - i); //n&1是最后一位,随后是位移31-i位

2021-07-30 17:05:52 86

原创 java刷题--231 2的幂

java刷题--231 2的幂题目代码结果题目代码class Solution { public boolean isPowerOfTwo(int n) { return n>0 && (n&(n-1))==0; //解释一些,2的幂次只有在最高位才是1其余都是0 }}结果

2021-07-30 17:02:24 85

原创 java刷题--338 比特位计数

java刷题--338 比特位计数题目代码结果题目代码动态规划class Solution { public int[] countBits(int num) { int[] res = new int[num + 1]; res[0] = 0; for(int i = 1;i<= num;i++){ res[i] = res[i & (i - 1)] + 1; //把最低位1去掉 }

2021-07-30 17:01:46 94

原创 java刷题--36有效的数独

java刷题--36有效的数独题目代码结果题目代码class Solution { public boolean isValidSudoku(char[][] board) { Set<Character> rowSet = new HashSet<>(); Set<Character> colSet = new HashSet<>(); Set<Character&

2021-07-30 01:24:03 108

原创 java刷题--51N皇后

java刷题--51N皇后题目代码结果题目代码class Solution { List<List<String>> res = new ArrayList<>(); public List<List<String>> solveNQueens(int n) { char[][] chessboard = new char[n][n]; for (char[] c : chessboard)

2021-07-30 00:54:27 229

原创 java刷题--130被围绕的区域

java刷题--130被围绕的区域题目代码结果题目代码class Solution { public void solve(char[][] board) { if (board == null || board.length == 0) return; int m = board.length; int n = board[0].length; for (int i = 0; i < m; i++) {

2021-07-29 15:42:24 87

原创 java刷题--杨辉三角II

java刷题--杨辉三角II题目代码结果题目代码可以说是非常简单了class Solution { public List<Integer> getRow(int rowIndex) { List<List<Integer>> C = new ArrayList<List<Integer>>(); for (int i = 0; i <= rowIndex; ++i) {

2021-07-27 19:30:32 103

原创 java刷题--118杨辉三角

java刷题--118杨辉三角题目代码结果题目代码class Solution { public List<List<Integer>> generate(int numRows) { List<List<Integer>> res = new ArrayList(); for(int i=0;i<numRows;i++) { List<Integer> level =

2021-07-27 19:27:13 131

原创 java刷题--264丑数II

java刷题--264丑数II题目代码结果题目代码class Solution { public int nthUglyNumber(int n) { int n2 = 0,n3 = 0,n5 = 0; int[] dp = new int[n]; dp[0] = 1; for(int i = 1;i<n;i++){ dp[i] = Math.min(2*dp[n2],Math.min(3*dp[n

2021-07-27 14:51:26 89

原创 剑指offer--38字符串的排列

剑指offer--38字符串的排列题目代码结果题目代码class Solution { public String[] permutation(String s) { List<String> list = new ArrayList(); char[] arr = s.toCharArray(); StringBuilder sb = new StringBuilder(); boolean[] visited =

2021-07-26 23:33:49 113

原创 剑指offer--31栈的压入、弹出序列

剑指offer--31栈的压入、弹出序列题目代码结果题目代码class Solution { public boolean validateStackSequences(int[] pushed, int[] popped) { Deque<Integer> stack = new ArrayDeque<>(); int j = 0; //索引popped for (int i = 0; i < pushed.le

2021-07-26 22:36:20 101

原创 剑指offer--40最小的k个数

剑指offer--40最小的k个数题目代码结果题目代码class Solution { public int[] getLeastNumbers(int[] arr, int k) { if (k == 0 || arr.length == 0) return new int[0]; //实现升序排列即头节点是最大的--需要重写一下比较器。 Queue<Integer> pq = new PriorityQueue<>(

2021-07-26 20:40:43 86

原创 剑指offer--35复杂链表的复制

剑指offer--35复杂链表的复制题目代码结果题目代码class Solution { public Node copyRandomList(Node head){ if(head == null) return null; Map<Node,Node> map = new HashMap<>(); for(Node cur = head; cur != null; cur = cur.next){

2021-07-26 19:32:12 101

原创 java刷题--208Trie前缀树

java刷题--208Trie前缀树题目代码结果题目腾讯二面–所以说知识点一定要全代码class Trie { private Trie[] children; private boolean isEnd; public Trie() { children = new Trie[26]; isEnd = false; } public void insert(String word) { Trie node =

2021-07-26 15:32:26 94

原创 java刷题--91解码方法

java刷题--91解码方法题目代码结果题目代码class Solution { public int numDecodings(String s) { int n = s.length(); int[] f = new int[n+1]; f[0] = 1; for (int i = 1; i <= n; i++) { //计算单干情况的累加和 if (s.charAt(i

2021-07-25 15:36:56 85

原创 java刷题--647回文子串

java刷题--647回文子串题目代码结果题目代码class Solution { public int countSubstrings(String s) { int n = s.length(); boolean[][] dp = new boolean[n][n]; int count=0; for(int j=0;j<n;j++) { for(int i=0;i<=j;i++) {

2021-07-25 12:45:09 89

原创 java刷题--621任务调度器

java刷题--621任务调度器题目代码结果题目代码class Solution { public int leastInterval(char[] tasks, int n) { char[] cnt = new char[26]; int maxn = 0; for (int task : tasks) { //A-0 B-1 C-2 D-3 E-4 cnt[task - 'A'] ++;

2021-07-25 10:58:13 102

原创 java刷题--61旋转链表

java刷题--61旋转链表题目代码结果题目代码先弄成循环链表再断开class Solution { public ListNode rotateRight(ListNode head, int k) { if(head==null || k==0) return head; ListNode tail=head; int len=1; while(tail.next!=null){ tail=tail

2021-07-25 09:16:47 81

原创 剑指offer--30 最小栈

剑指offer--30 最小栈题目代码结果题目代码这代码舒服class MinStack { Stack<Integer> A, B; public MinStack() { A = new Stack<>(); B = new Stack<>(); } public void push(int x) { A.add(x); if(B.empty() || B.pee

2021-07-25 00:32:38 60

原创 java刷题--221最大正方形

java刷题--221最大正方形题目代码结果题目代码当且仅当右下角大于等于1时构成正方形,此时右下角的值即正方形边长class Solution { public int maximalSquare(char[][] matrix) { int maxSide = 0; if (matrix == null || matrix.length == 0 || matrix[0].length == 0) return maxSide; int

2021-07-24 23:19:20 108

原创 java刷题--64最小路径和

java刷题--64最小路径和题目代码结果题目代码class Solution { public static int minPathSum(int[][] grid) { int height = grid.length; int width = grid[0].length; for (int row = 0; row < height; row++) { for (int col = 0; col <

2021-07-24 23:07:49 99

原创 java刷题--518零钱兑换II

java刷题--518零钱兑换II题目代码结果题目代码class Solution { public int change(int amount, int[] coins) { int[] dp = new int[amount + 1]; dp[0] = 1; for (int coin : coins) { for (int i = coin; i <= amount; i++) {

2021-07-24 22:56:00 111

原创 java刷题--编辑距离

java刷题--编辑距离题目代码结果题目代码class Solution { public int minDistance(String word1, String word2) { int n = word1.length(); int m = word2.length(); // 有一个字符串为空串 if (n * m == 0) {return n + m;} int[][] D = new int[n +

2021-07-24 22:03:43 64

原创 java刷题--279完全平方数

java刷题--279完全平方数题目代码结果题目代码class Solution { public int numSquares(int n) { int[] dp = new int[n + 1]; Arrays.fill(dp,60); dp[0] = 0; for (int i = 1; i <= n; i++) { for (int j = 1; j * j <= i; j++) {

2021-07-24 21:32:13 65

原创 java刷题--322零钱兑换

java刷题--322零钱兑换题目代码结果题目代码public class Solution { public int coinChange(int[] coins, int amount) { int max = amount + 1; int[] dp = new int[max]; Arrays.fill(dp, max); dp[0] = 0; for (int i = 1; i <= amount

2021-07-24 21:13:04 98

原创 剑指offer--26树的子结构

剑指offer--26树的子结构题目代码结果题目代码class Solution { public boolean isSubStructure(TreeNode A, TreeNode B) { if (B == null || A == null) return false; if (A.val == B.val && (helper(A.left, B.left) && helper(A.right, B.right)))

2021-07-24 09:15:33 115

原创 剑指offer--22链表中倒数第k个节点

剑指offer--22链表中倒数第k个节点题目代码结果题目代码class Solution { public ListNode getKthFromEnd(ListNode head, int k) { ListNode fast = head,slow = head; for(int i=0;i<k;i++) { fast = fast.next; } while(fast!=null) {

2021-07-24 08:30:44 76

原创 java刷题--120三角形最小路径和

java刷题--120三角形最小路径和题目代码结果题目代码class Solution { public int minimumTotal(List<List<Integer>> triangle) { if (triangle == null || triangle.size() == 0) return 0; // 加1可以不用初始化最后一层 int[][] dp = new int[triangle.size()+

2021-07-23 22:52:51 87

原创 java刷题--100相同的树

java刷题--100相同的树题目代码结果题目代码class Solution { public boolean isSameTree(TreeNode p, TreeNode q) { if (p == null && q == null) { return true; } else if (p == null || q == null) { return false; } el

2021-07-22 23:53:28 62

原创 剑指offer--29顺时针打印矩阵

剑指offer--29顺时针打印矩阵题目代码结果题目代码public class Solution { public int[] spiralOrder(int[][] matrix) { int row = matrix.length; if (row == 0) return new int[0]; int col = matrix[0].length; int[] res = new int[row * col];

2021-07-22 23:50:00 135 1

原创 剑指offer--28对称的二叉树

剑指offer--28对称的二叉树题目代码结果题目代码class Solution { public boolean isSymmetric(TreeNode root) { if (root == null) return true; return helper(root.left, root.right); } public boolean helper(TreeNode root1, TreeNode root2) {

2021-07-22 22:38:33 70

原创 剑指offer--27二叉树的镜像

剑指offer--27二叉树的镜像题目代码结果题目代码class Solution { public TreeNode mirrorTree(TreeNode root) { if(root == null) return null; LinkedList<TreeNode> queue = new LinkedList<>(); queue.offer(root); //其实就是假前序遍历

2021-07-22 19:01:59 83

原创 java刷题--413等差数列划分

java刷题--413等差数列划分题目代码结果题目代码public class Solution { public int numberOfArithmeticSlices(int[] A) { int dp = 0; int sum = 0; for (int i = 2; i < A.length; i++) { if (A[i] - A[i - 1] == A[i - 1] - A[i - 2]) {

2021-07-22 12:49:32 60

原创 java刷题--42接雨水

java刷题--42接雨水题目代码结果题目代码暴力法class Solution { public int trap(int[] height) { int ans = 0; int size = height.length; for (int i = 1; i < size - 1; i++) { int max_left = 0, max_right = 0; for (int j =

2021-07-22 12:28:06 89

原创 java刷题--139单词拆分

java刷题--139单词拆分题目代码结果题目代码public class Solution { public boolean wordBreak(String s, List<String> wordDict) { Set<String> wordDictSet = new HashSet(wordDict); boolean[] dp = new boolean[s.length() + 1]; dp[0] = tr

2021-07-22 10:52:12 63

原创 剑指offer--21调整数组顺序使奇数位于偶数前

剑指offer--21调整数组顺序使奇数位于偶数前题目代码结果题目代码class Solution { public int[] exchange(int[] nums) { int i=0,j=0; while(j<nums.length){ //奇数与1是1,偶数与1是0 if((nums[j]&1)!=0){ int tmp=nums[i];

2021-07-19 23:29:12 115 2

线性系统理论_阙志宏网盘链接.txt

仅供交流学习 考博需要

2021-04-26

管理信息系统15版百度网盘.txt

大小为178MB左右

2021-03-26

cuda+pytorch一套百度网盘链接.txt

最新版本安装pytorch和cuda+cudnn+torchvision一套组件,大小大概为3个G左右。

2021-03-24

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除