文章分类 -  算法 / C

leet_code
摘要://滑动窗口 int lengthOfLongestSubstring(char * s) { int len ,i,r,l,max; r = l =max = 0; //r-->右 l-->左; while(s[r]) {//当右指针指向的字符存在时,即没有结束滑动 for(i = l; i< r 阅读全文
posted @ 2023-10-24 21:09 44556677 阅读(18) 评论(0) 推荐(0)
摘要:/** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ //进位 //改善-->直接在原链表上加:将短链表的值加到新链表上 struct List 阅读全文
posted @ 2023-10-24 21:07 44556677 阅读(164) 评论(0) 推荐(0)
摘要://哈希表 typedef struct//自定义哈希表的结构 { int key; int val; UT_hash_handle hh;//初始化为NULL } hashTable; int* twoSum(int* nums, int numsSize, int target, int* re 阅读全文
posted @ 2023-10-24 21:05 44556677 阅读(17) 评论(0) 推荐(0)