摘要:
/** * 剑指 Offer 25. 合并两个排序的链表 * https://leetcode.cn/problems/he-bing-liang-ge-pai-xu-de-lian-biao-lcof/ * */ public class Solution { public ListNode me 阅读全文
摘要:
双指针 /** * 剑指 Offer 24. 反转链表 * https://leetcode.cn/problems/fan-zhuan-lian-biao-lcof/ * * 思路:双指针 * */ public class Solution1 { public ListNode reverseL 阅读全文
摘要:
/** * 剑指 Offer 22. 链表中倒数第k个节点 * https://leetcode.cn/problems/lian-biao-zhong-dao-shu-di-kge-jie-dian-lcof/ * * 思路:快慢指针 * */ public class Solution { pu 阅读全文
摘要:
/** * 剑指 Offer 21. 调整数组顺序使奇数位于偶数前面 * https://leetcode.cn/problems/diao-zheng-shu-zu-shun-xu-shi-qi-shu-wei-yu-ou-shu-qian-mian-lcof/ * * 思路:快排思想 * */ 阅读全文
摘要:
/** * 剑指 Offer 18. 删除链表的节点 * https://leetcode.cn/problems/shan-chu-lian-biao-de-jie-dian-lcof/ * * 思路:双指针 * */ public class Solution { public ListNode 阅读全文
摘要:
大数问题 /** * 剑指 Offer 17. 打印从1到最大的n位数 * https://leetcode.cn/problems/da-yin-cong-1dao-zui-da-de-nwei-shu-lcof/ * * 思路:回溯思想 * 考虑大数问题(用字符串或数组表示大数) * */ pu 阅读全文
摘要:
/** * 剑指 Offer 16. 数值的整数次方 * https://leetcode.cn/problems/shu-zhi-de-zheng-shu-ci-fang-lcof/ * * 思路:快速幂 * x^n = x^a * x^b (n=a+b) * 13 = 1101 (十进制转二进制 阅读全文
摘要:
位移 /** * 剑指 Offer 15. 二进制中1的个数 * https://leetcode.cn/problems/er-jin-zhi-zhong-1de-ge-shu-lcof/ * * 思路:位移 * */ public class Solution1 { public int ham 阅读全文