随笔分类 -  算法

摘要:力扣90. 子集 II 1、C /** * Return an array of arrays of size *returnSize. * The sizes of the arrays are returned as *returnColumnSizes array. * Note: Both 阅读全文
posted @ 2023-07-09 10:55 菜鸟冲冲冲 阅读(25) 评论(0) 推荐(0)
摘要:力扣78. 子集 1、C /** * Return an array of arrays of size *returnSize. * The sizes of the arrays are returned as *returnColumnSizes array. * Note: Both ret 阅读全文
posted @ 2023-07-04 21:50 菜鸟冲冲冲 阅读(19) 评论(0) 推荐(0)
摘要:力扣146. LRU 缓存 1、C typedef struct { int key; int val; UT_hash_handle hh; } LRUCache; LRUCache* usr = NULL; int size = 0; LRUCache* lRUCacheCreate(int c 阅读全文
posted @ 2023-06-30 22:12 菜鸟冲冲冲 阅读(16) 评论(0) 推荐(0)
摘要:力扣148. 排序链表 1、C /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode* sortList(str 阅读全文
posted @ 2023-05-12 11:00 菜鸟冲冲冲 阅读(16) 评论(0) 推荐(0)
摘要:力扣142. 环形链表 II 1、C /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode *detectCyc 阅读全文
posted @ 2023-05-08 08:59 菜鸟冲冲冲 阅读(23) 评论(0) 推荐(0)
摘要:力扣138. 复制带随机指针的链表 1、C /** * Definition for a Node. * struct Node { * int val; * struct Node *next; * struct Node *random; * }; */ struct hashTable{ st 阅读全文
posted @ 2023-05-04 22:53 菜鸟冲冲冲 阅读(15) 评论(0) 推荐(0)
摘要:力扣147. 对链表进行插入排序 1、C /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode* inserti 阅读全文
posted @ 2023-04-20 14:49 菜鸟冲冲冲 阅读(28) 评论(0) 推荐(0)
摘要:力扣141. 环形链表 1、C /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ bool hasCycle(struct ListNode 阅读全文
posted @ 2023-04-17 10:31 菜鸟冲冲冲 阅读(36) 评论(0) 推荐(0)
摘要:力扣160. 相交链表 1、C /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode *getIntersect 阅读全文
posted @ 2023-04-12 09:55 菜鸟冲冲冲 阅读(20) 评论(0) 推荐(0)
摘要:力扣21. 合并两个有序链表 1、C /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode* mergeTwoL 阅读全文
posted @ 2023-04-07 10:23 菜鸟冲冲冲 阅读(25) 评论(0) 推荐(0)
摘要:力扣143. 重排链表 1、C /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ void reorderList(struct ListN 阅读全文
posted @ 2023-04-04 20:27 菜鸟冲冲冲 阅读(29) 评论(0) 推荐(0)
摘要:力扣61. 旋转链表 1、C /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode* rotateRight(s 阅读全文
posted @ 2023-03-25 16:18 菜鸟冲冲冲 阅读(26) 评论(0) 推荐(0)
摘要:力扣92. 反转链表 II 1、C /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode* reverseBet 阅读全文
posted @ 2023-03-13 09:13 菜鸟冲冲冲 阅读(25) 评论(0) 推荐(0)
摘要:力扣206. 反转链表 1、C /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode* reverseList( 阅读全文
posted @ 2023-03-09 09:16 菜鸟冲冲冲 阅读(18) 评论(0) 推荐(0)
摘要:力扣83. 删除排序链表中的重复元素 1、C /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode* delet 阅读全文
posted @ 2023-03-05 10:07 菜鸟冲冲冲 阅读(25) 评论(0) 推荐(0)
摘要:力扣19. 删除链表的倒数第 N 个结点 1、C /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode* rem 阅读全文
posted @ 2023-03-01 09:21 菜鸟冲冲冲 阅读(13) 评论(0) 推荐(0)
摘要:47. 全排列 II 1、C /** * Return an array of arrays of size *returnSize. * The sizes of the arrays are returned as *returnColumnSizes array. * Note: Both r 阅读全文
posted @ 2023-02-25 09:50 菜鸟冲冲冲 阅读(17) 评论(0) 推荐(0)
摘要:力扣40. 组合总和 II 1、C void back(int* candidates, int candidatesSize, int target,int start,int *path,int *pathSize,int **result,int** returnColumnSizes,int 阅读全文
posted @ 2022-12-15 12:48 菜鸟冲冲冲 阅读(37) 评论(0) 推荐(0)
摘要:力扣46.全排列 1、C /** * Return an array of arrays of size *returnSize. * The sizes of the arrays are returned as *returnColumnSizes array. * Note: Both ret 阅读全文
posted @ 2022-11-25 12:45 菜鸟冲冲冲 阅读(38) 评论(0) 推荐(0)
摘要:题目描述 输入n个整数,依次输出每个数的约数的个数 输入描述: 输入的第一行为N,即数组的个数(N<=1000) 接下来的1行包括N个整数,其中每个数的范围为(1<=Num<=1000000000) 当N=0时输入结束。 输出描述: 可能有多组输入数据,对于每组输入数据, 输出N行,其中每一行对应上 阅读全文
posted @ 2020-02-24 15:48 菜鸟冲冲冲 阅读(223) 评论(0) 推荐(0)