![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
此专栏写一些算法相关的试题
Vince629
create something
展开
-
链表的解法
链表的解法技巧哈希表 数组快慢指针练习判断链表是否是回文第一种方法 加入栈中 然后遍历 栈弹出第二种方法 先用快慢指针找到中点 然后右半部分放入栈中 然后再比对第三种方法 先用快慢指针找到中点 然后右半部分反转链表 特别注意将链表反转回来返回单链表克隆问题 其中有random 指针第一种 map 遍历两遍第二种 先将克隆节点放在节点中间 然后处理random 指针 然后拆分链表给定两个可能有环也可能无环的单链表,头节点head1 和head2如果两个链表相交, 请返回相原创 2022-01-05 01:02:44 · 436 阅读 · 0 评论 -
异或运算之初探
算法和数据结构对数器 二分法 异或运算知道怎么算的算法知道怎么试的算法本质是递归的掌握能力二分法有序数组异或运算相同为0 不同为1无进位相加! 0^N == N N^N == 0 练习:不申请额外变量交换两个变量的值 a = a ^ b b = a ^ b a = a ^ b...原创 2022-01-04 00:48:27 · 138 阅读 · 0 评论 -
每日一题-Regular Expression Matching (Java)
Regular Expression Matching (Java)Implement regular expression matching with support for ‘.’ and ‘*’.‘.’ Matches any single character.‘*’ Matches zero or more of the preceding element.The matching should cover the entire input string (not partial).The原创 2021-12-19 21:45:56 · 77 阅读 · 0 评论