相关文章
Redis的常见数据结构
Redis内部数据结构 1. redis数据结构和内部编码2. string2.1 常见命令2.2 计数命令2.3 字符串操作命令2.4 典型使用场景 3. hash3.1 常见命令3.2 hash内部编码3.3 使用场景 4. list4.1 常见命令4.2 阻塞版本命令4.3 使用场景 5. set5.1 常见命令5.2 集合间操作5.3 使用场景 6. …
建站知识
2025/2/27 4:00:48
CTF-web:java-h2 堆叠注入rce -- N1ctf Junior EasyDB
代码存在sql注入 // 处理登录表单的POST请求PostMapping({"/login"})public String handleLogin(RequestParam String username, RequestParam String password, HttpSession session, Model model) throws SQLException {// 验证用户凭据if (this.userService.valid…
建站知识
2025/2/28 12:08:14
力扣-二叉树-111 二叉树的最小深度
思路1
利用前序遍历,根左右
代码1
class Solution {
public:int result 10005;void getDepth(TreeNode* node, int depth){if(node->left nullptr && node->right nullptr){if(depth < result){result depth;}}if(node->left){depth;get…
建站知识
2025/2/27 16:40:27
AcWing——3722. 骑车路线
双指针解法
#include<bits/stdc.h>
using namespace std;
typedef long long ll;
const int N 10005;
int a[N];int main() {ios::sync_with_stdio(0), cout.tie(0), cin.tie(0);int n;while(cin >> n) {int ans 0;if(n 1) {cout << 0 << endl;con…
建站知识
2025/2/27 18:49:36
独立C++ asio库实现的UDP Server
以下是一个使用独立的 C Asio 库实现的 UDP 服务器的示例代码。这个 UDP 服务器可以监听指定端口,接收客户端发送的数据,并将接收到的数据原样返回给客户端。
#include <iostream>
#include <asio.hpp>
#include <array>class UdpSer…
建站知识
2025/2/27 3:25:48
在分布式场景下可以使用synchronized加锁么?
首先说结论,在分布式系统中,单纯使用 Java 中的 synchronized 关键字是无法满足需求的,下面从 synchronized 的作用原理、在分布式场景下的局限性以及替代方案等方面详细分析。
一、synchronized 的作用原理 在 Java 中,synchron…
建站知识
2025/2/25 19:09:19