梅花香自苦寒来

happy coding

  • 博客(265)
  • 资源 (24)
  • 收藏
  • 关注

原创 LeetCode 常见题型汇总

前30剪枝二分查找字典树位运算动态规划并查集LRU缓存布隆过滤器。

2024-07-21 23:49:28 254 1

原创 除了做分页,Mybatis插件机制还能这么玩

【代码】除了做分页,Mybatis插件机制还能这么玩。

2022-03-13 21:14:57 1305

原创 通用化递归建树与裁剪树

通用化递归建树与裁剪树

2022-03-13 08:20:03 1018

原创 【LeetCode 0006】【字符/几何】Z字形变换

The string is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)And then read line by line: Write the code that will take a string and make this conversion given a

2024-07-29 10:00:00 145

原创 【LeetCode 0005】【动态规划】最长回文子串

Given a string , return the longest palindromic substring in .Example 1:Example 2:Constraints:

2024-07-28 22:43:01 180

原创 【LeetCode 0004】【数组/分治】寻找两个正序数组的中位数

Given two sorted arrays and of size and respectively, return the median of the two sorted arrays.The overall run time complexity should be .Example 1:Example 2:Constraints:

2024-07-25 08:00:00 178

原创 【LeetCode 0003】【滑动窗口】无重复字符的最长子串

Given a string `s`, find the length of the **longest** **substring** without repeating characters.

2024-07-24 23:34:45 417 1

原创 【LeetCode 0002】【链表】两数相加

You are given two **non-empty** linked lists representing two non-negative integers. The digits are stored in **reverse order**, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.

2024-07-24 23:31:12 355

原创 【LeetCode 0037】【回溯/剪枝】解数独

Write a program to solve a Sudoku puzzle by filling the empty cells.A sudoku solution must satisfy all of the following rules:The character indicates empty cells.Example 1:Constraints:

2024-07-22 00:03:16 311

原创 【LeetCode 0338】【位运算/递归式】求比特位

Given an integer , return *an array of length such that for each (), is the number of ’s in the binary representation of *.Example 1:Example 2:Constraints:Follow up:

2024-07-21 08:00:00 649 1

原创 【LeetCode 0231】【位运算】2的N次方

Given an integer , return if it is a power of two. Otherwise, return .An integer is a power of two, if there exists an integer such that .Example 1:Example 2:Example 3:Constraints:Follow up: Could you solve it without loops/recursion?

2024-07-20 23:38:28 368 1

原创 【LeetCode 0191】【位运算】求1的个数

Write a function that takes the binary representation of a positive integer and returns the number of set bits it has (also known as the Hamming weight).Example 1:Output: 3Explanation:The input binary string 1011 has a total of three set bits.Example 2:Out

2024-07-19 09:34:10 377

原创 【LeetCode 0069】【二分查找】求平方根

Given a non-negative integer , return the square root of rounded down to the nearest integer. The returned integer should be non-negative as well.You must not use any built-in exponent function or operator.Example 1:Example 2:Constraints:

2024-07-17 23:43:01 314

原创 【LeetCode 0051】【剪枝】N皇后

The n-queens puzzle is the problem of placing queens on an chessboard such that no two queens attack each other.Given an integer , return all distinct solutions to the n-queens puzzle. You may return the answer in any order.Each solution contains a disti

2024-07-15 23:53:32 681

原创 【LeetCode 0022】【DSF】生成括号

Given `n` pairs of parentheses, write a function to *generate all combinations of well-formed parentheses*.

2024-07-14 18:22:22 160

原创 【LeetCode 0111】【递归/分治】二叉树的最小深度

0, 10^5]

2024-07-13 14:21:45 311 2

原创 【LeetCode 0104】【递归/分治】二叉树的最大深度

Given the of a binary tree, return its maximum depth.A binary tree’s maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Example 1:Example 2:Constraints:

2024-07-13 14:16:52 367 2

原创 【LeetCode 0102】【BSF/DSF】二叉树的层级遍历

Given the of a binary tree, return the level order traversal of its nodes’ values. (i.e., from left to right, level by level).Example 1:Example 2:Example 3:Constraints:

2024-07-12 23:47:56 239 1

原创 【LeetCode 0122】【DSF/DP/Greedy】买卖股票的最佳时机2

You are given an integer array where is the price of a given stock on the day.On each day, you may decide to buy and/or sell the stock. You can only hold at most one share of the stock at any time. However, you can buy it then immediately sell it on the

2024-07-11 23:06:54 301

原创 【LeetCode 0169】【摩尔投票算法】主元素

Given an array of size , return the majority element.The majority element is the element that appears more than times. You may assume that the majority element always exists in the array.Example 1:Example 2:Constraints:Follow-up: Could you solve the pr

2024-07-11 22:44:33 649

原创 【LeetCode 0236】【递归】求二叉树的最近公共祖先

qpq。

2024-07-10 23:42:43 609

原创 【LeetCode 0235】【递归】求二叉查找树的最近公共祖先

qpq。

2024-07-10 23:27:27 556

原创 【LeetCode 0050】【分治/递归】求x的n次方

Implement pow(x, n), which calculates raised to the power (i.e., ).Example 1:Example 2:Example 3:Constraints:

2024-07-09 23:58:16 337

原创 【LeetCode 0088】 【数组/双指针】合并两个有序数组

You are given two integer arrays and , sorted in non-decreasing order, and two integers and , representing the number of elements in and respectively.Merge and into a single array sorted in non-decreasing order.The final sorted array should not be re

2024-07-09 23:43:09 236

原创 【LeetCode 0070】【递归/动态规划】爬楼梯

n1or2。

2024-07-08 23:28:42 210 1

原创 【LeetCode 0098】【BST】验证有效的二叉查找树

Given the of a binary tree, determine if it is a valid binary search tree (BST).A valid BST is defined as follows:Example 1:Example 2:Constraints:

2024-07-08 09:30:00 412

原创 【LeetCode 0239】【大堆/双端队列】滑动窗口中的最大值

You are given an array of integers , there is a sliding window of size which is moving from the very left of the array to the very right. You can only see the numbers in the window. Each time the sliding window moves right by one position.Return the max

2024-07-07 18:10:24 195

原创 【LeetCode 0141】【链表】【双指针之快慢指针】判断给定单链表是否存在环

Given , the head of a linked list, determine if the linked list has a cycle in it.There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the pointer. Internally, is used to denote the index

2024-07-07 13:51:29 599

原创 【LeetCode 0024】【链表】交换单链表相邻两个节点

0, 100]

2024-07-07 13:39:15 407

原创 【LeetCode 0206】【链表】反转单链表

Given the of a singly linked list, reverse the list, and return the reversed list.Example 1:Example 2:Example 3:Constraints:Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both?

2024-07-06 17:24:12 220

原创 【LeetCode 0242】【Map/排序】有效的异位词

Given two strings and , return if is an anagram of , and otherwise.An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.Example 1:Example 2:Constraints:F

2024-07-05 23:23:19 174

原创 【LeetCode 0146】【设计】【双向循环链表】实现LRU缓存

Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.Implement the class:The functions and must each run in average time complexity.Example 1:Constraints:

2024-07-04 20:31:48 424

原创 【LeetCode 0703】【设计】【优先队列】返回数据流中第K大的元素

Design a class to find the largest element in a stream. Note that it is the largest element in the sorted order, not the distinct element.Implement class:Example 1:Constraints:

2024-07-03 23:56:38 201

原创 【LeetCode 0232】【设计】用FILO栈实现FIFO队列

Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (, , , and ).Implement the class:* Pushes element x to the back of the queue.* Removes the element from the front

2024-07-03 20:53:59 565

原创 【LeetCode 0225】【设计】用FIFO队列实现FILO栈

Implement a last-in-first-out (LIFO) stack using only two queues. The implemented stack should support all the functions of a normal stack (, , , and ).Implement the class:Notes:Example 1:Constraints:Follow-up: Can you implement the stack using only one

2024-07-02 23:22:20 745

原创 【LeetCode 0020】【栈】有效的括号

Given a string containing just the characters , , , , and , determine if the input string is valid.An input string is valid if:Example 1:Example 2:Example 3:Constraints:* * consists of parentheses only .

2024-07-01 23:59:53 253

原创 【网友问答】邻接矩阵的BSF/DSF遍历问题

网友提问解答

2024-05-31 20:59:22 123

原创 【Go基础】快速入门

用20%的时间学习常用80%的语法。

2024-05-31 20:41:24 639

原创 【Daily Pratice】【数组】之子数组问题--题解(7)

【代码】【Daily Pratice】【数组】之子数组问题--题解(7)

2024-03-19 23:48:20 312

原创 【Daily Pratice】【数组】之子数组问题--题解(4-6)

【代码】【Daily Pratice】【数组】之子数组问题--题解(4-5)

2024-03-18 23:20:12 794

springMVC+mybatis+maven+junit

springMVC,mybatis,maven,junit

2015-05-15

逆波兰式表达式计算引擎

逆波兰式表达式计算引擎 ReversePolishExpression Tool V1.0.1 Feature 1.Attention! the input expression isn't allowed to constants Invalid Characters like '_、#' 2.It's supported the calculation of div(/) mod(%) sqrt(_) mul(*) sub(-) pow(^) 3.The Usage: there is needly two HashMap<String,Object> .One as the input paramters and another was put into the first HashMap for passing the expression's values.The parent HashMap contains lots of placeholders, just like the 'AA'、'BB'、'CC' see the example code below. eg. HashMap<String,Object> maps = new HashMap<String,Object>(); HashMap<String,Object> kvmap = new HashMap<String,Object>(); maps.put("expression", "(((AA*-BB)*CC+(AA*-BB)/CC)+((AA*(-BB))*CC+(AA*-BB)%CC))"); kvmap.put("AA", 4); kvmap.put("BB", 2); kvmap.put("CC", 9); maps.put("kvmap", kvmap); System.out.println("使用工具结果:"+ReversePolishExpression.calculateExpression(maps));

2014-11-10

JavaWebServiceClient.zip(客户端)

JavaWebServiceClient.zip(客户端)

2013-03-04

JavaWebServiceApp.zip(服务器)

JavaWebServiceApp.zip

2013-03-04

java版远程控制的实例demo

java版远程控制的源代码,仅供学习!

2013-01-26

简易文本编辑器

自己写的一个文本编辑器,支持多语言,多风格,简洁漂亮,经过CHROME,FIREFOX,IE等测试。

2012-03-03

<算法分析与设计>试卷

算法试卷算法试卷算法试卷算法试卷算法试卷算法试卷算法试卷算法试卷算法试卷

2011-01-14

计算机体系结构答案(清华大学出版社).

计算机体系结构答案(清华大学出版社)(中英答案都有)

2010-10-27

j2me手机浏览器/j2me手机浏览器

j2me手机浏览器 j2me手机浏览器 j2me手机浏览器

2010-07-11

用J2SE实现原网页浏览器(java)

用J2SE实现原网页浏览器 用J2SE实现原网页浏览器 用J2SE实现原网页浏览器

2010-07-11

2010下半学期广工大数据库总复习资料

2010下半学期广工大数据库总复习资料 2010下半学期广工大数据库总复习资料

2010-06-29

飞鸽传书2007绿色版下载.zip

飞鸽传书2007绿色版下载.zip 飞鸽传书2007绿色版下载.zip 飞鸽传书2007绿色版下载.zip

2010-06-17

企业员工管理系统(Java技术).rar

企业员工管理系统(Java技术).rar

2010-06-17

操作系统复习试题汇总及答案

操作系统复习试题汇总及答案2009、2010年 操作系统复习试题汇总及答案 操作系统复习试题汇总及答案 操作系统复习试题汇总及答案

2010-06-12

操作系统试题与答案-操作系统试题与答案

操作系统试题与答案 操作系统试题与答案 操作系统试题与答案

2010-06-12

新闻管理系统——jsp版

新闻管理系统——jsp版 用java实现 新闻管理系统

2010-04-14

C语言 课程设计 五子棋

C语言 课程设计 五子棋,C语言 课程设计 五子棋,C语言 课程设计 五子棋,C语言 课程设计 五子棋

2010-04-14

C语言课程设计代码——一字棋小游戏

C语言课程设计代码——一字棋小游戏,C语言课程设计代码——一字棋小游戏C语言课程设计代码——一字棋小游戏,C语言课程设计代码——一字棋小游戏

2010-04-14

空空如也

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

TA关注的人

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