陪我吹吹海风吧
陪我吹吹海风吧
全部文章
分类
归档
标签
去牛客网
登录
/
注册
陪我吹吹海风吧的博客
全部文章
(共22篇)
题解 | #删除链表的节点#
/** * struct ListNode { * int val; * struct ListNode *next; * }; */ /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param head ListNode类 ...
2023-12-22
0
180
题解 | #合并两个排序的链表#
/** * struct ListNode { * int val; * struct ListNode *next; * }; */ /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param pHead1 ListNode...
2023-12-14
0
166
题解 | #反转链表#很简单,新建节点插在末尾就行
/** * struct ListNode { * int val; * struct ListNode *next; * }; */ /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param head ListNode类 ...
2023-12-14
0
194
题解 | #【模板】链表#
#include <stdio.h> #include <stdlib.h> #include <string.h> // 定义链表节点结构体 struct Node { int data; struct Node* next; }; typed...
2023-12-13
0
202
题解 | #【模板】循环队列#想抱抱他,又怕他生气
#include <stdio.h> #include <stdlib.h> #include <string.h> struct node { int* data; // 动态分配的数组 int front; int rear; ...
2023-12-12
0
219
题解 | #【模板】队列#
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_SIZE 100000 // 修改队列的最大容量 struct node { int data[MAX_SI...
2023-12-11
0
203
题解 | #表达式求值#
#include <stdio.h> #include <stdlib.h> #include <string.h> int getPriority(char op) { if (op == '+' || op == '-') return 1; ...
2023-12-10
0
193
题解 | #点击消除#利用栈的思维就行
#include <stdio.h> #include <string.h> int main() { char str[300000]; // 假设字符数组的大小为300000 scanf("%s", str); // 读取字符串并存...
2023-12-08
0
184
#逆波兰表达式求值#2023/12/7 今天有点郁闷呢
#include <string.h> #include <stdlib.h> int evalRPN(char** tokens, int tokensLen) { int stack[tokensLen]; int top = -1; for ...
2023-12-07
0
199
题解 | #有效括号序列#2023 /12/06风风轻轻吹
bool isValid(char* s) { int len = strlen(s); char stack[len]; // 使用字符数组模拟栈 int top = -1; // 栈顶指针 for (int i = 0; i < len; i++) { ...
2023-12-06
0
224
首页
上一页
1
2
3
下一页
末页