咸鱼八宝粥
咸鱼八宝粥
全部文章
分类
归档
标签
去牛客网
登录
/
注册
咸鱼八宝粥的博客
全部文章
(共13篇)
题解 | #统计字符串中子串出现的次数# O(N)
#include <iostream> #include <cstring> using namespace std; int main() { char str[100] = { 0 }; char substr[100] = { 0 }; c...
2023-03-24
0
248
题解 | #判断一个链表是否为回文结构# C语言 反转链表
/** * struct ListNode { * int val; * struct ListNode *next; * }; */ /** * * @param head ListNode类 the head * @return(756076230) bool布尔型 */ ...
2023-01-21
0
328
题解 | #单链表的排序# C语言:归并排序
/** * struct ListNode { * int val; * struct ListNode *next; * }; */ /** * * @param head ListNode类 the head node * @return(756076230) ListNod...
2023-01-21
0
379
题解 | #删除有序链表中重复的元素-I# 快慢指针法
/** * struct ListNode { * int val; * struct ListNode *next; * }; */ /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param head ListNode类 ...
2023-01-19
0
425
题解 | #删除链表的倒数第n个节点# C语言快慢指针
/** * struct ListNode { * int val; * struct ListNode *next; * }; */ /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param head ListNode类 ...
2023-01-18
0
295
题解 | #链表中倒数最后k个结点# C语言基础遍历解决
struct ListNode* cur=pHead; struct ListNode* plist=pHead; int size=0; while(cur != NULL) { size++; cur=cur->next; } if(size-k>=0) { ...
2023-01-18
0
257
题解 | #判断链表中是否有环# 快慢指针
#include <stdbool.h> /** * struct ListNode { * int val; * struct ListNode *next; * }; */ /** * * @param head ListNode类 * @return(7560...
2023-01-18
0
289
题解 | #地下迷宫#
#include<stdlib.h>#include<string.h>#include<assert.h>typedef struct Postion{ int row; int col;}PT;///////...
2023-01-16
0
371
题解 | #牛牛的双链表求和#
#include <stdio.h> #include<stdlib.h> //单链表 typedef struct DListNode { struct DListNode* next; int data; }LN; //增加节点 LN* BuyNode...
2023-01-12
0
334
题解 | #获得月份天数#
#include <stdio.h> int main() { int a,b; int arr1[1...
C
2022-11-16
0
228
首页
上一页
1
2
下一页
末页