Skip to main content

剑指offer

面试题3:数组中重复的数字

https://leetcode.cn/problems/shu-zu-zhong-zhong-fu-de-shu-zi-lcof/

面试题4:二维数组中的查找

https://leetcode.cn/problems/er-wei-shu-zu-zhong-de-cha-zhao-lcof/

面试官5:替换空格

https://leetcode.cn/problems/ti-huan-kong-ge-lcof/

面试题6:从尾到头打印链表

https://leetcode.cn/problems/cong-wei-dao-tou-da-yin-lian-biao-lcof/

面试题9:用两个栈实现队列

https://leetcode.cn/problems/yong-liang-ge-zhan-shi-xian-dui-lie-lcof/

面试题10-1:斐波那契数列

https://leetcode.cn/problems/fei-bo-na-qi-shu-lie-lcof/

面试题10-2:青蛙跳台阶问题

https://leetcode.cn/problems/qing-wa-tiao-tai-jie-wen-ti-lcof/

面试题11:旋转数组的最小数字

https://leetcode.cn/problems/xuan-zhuan-shu-zu-de-zui-xiao-shu-zi-lcof/

面试题12:矩阵中的路径

https://leetcode.cn/problems/ju-zhen-zhong-de-lu-jing-lcof/

面试题13:机器人的运动范围

https://leetcode.cn/problems/ji-qi-ren-de-yun-dong-fan-wei-lcof/

面试题14-1:剪绳子

https://leetcode.cn/problems/jian-sheng-zi-lcof/

面试题15:二进制中1的个数 https://leetcode.cn/problems/er-jin-zhi-zhong-1de-ge-shu-lcof/

class Solution { public int hammingWeight(int n) { int count = 0; for (int i = 0; i < 32; i++) { if ((n & (1 << i)) != 0) { count++; } } return count; } }

面试题16:数值的整数次方

https://leetcode.cn/problems/shu-zhi-de-zheng-shu-ci-fang-lcof/

面试题17:打印从1到最大的n位数

https://leetcode.cn/problems/da-yin-cong-1dao-zui-da-de-nwei-shu-lcof/

面试题18:删除链表的节点

https://leetcode.cn/problems/shan-chu-lian-biao-de-jie-dian-lcof/

面试题20:表示数值的字符串

https://leetcode.cn/problems/biao-shi-shu-zhi-de-zi-fu-chuan-lcof/

面试题21:调整数组顺序使奇数位于偶数前面

https://leetcode.cn/problems/diao-zheng-shu-zu-shun-xu-shi-qi-shu-wei-yu-ou-shu-qian-mian-lcof/

面试题22:链表中倒数第k个节点

https://leetcode.cn/problems/lian-biao-zhong-dao-shu-di-kge-jie-dian-lcof/

面试题24:反转链表

https://leetcode.cn/problems/fan-zhuan-lian-biao-lcof/

面试题25:合并两个排序的链表

https://leetcode.cn/problems/he-bing-liang-ge-pai-xu-de-lian-biao-lcof/

面试题26:树的子结构

https://leetcode.cn/problems/shu-de-zi-jie-gou-lcof/

面试题27:二叉树的镜像

https://leetcode.cn/problems/er-cha-shu-de-jing-xiang-lcof/

面试题28:对称的二叉树

https://leetcode.cn/problems/dui-cheng-de-er-cha-shu-lcof/

面试题29:顺时针打印矩阵

https://leetcode.cn/problems/shun-shi-zhen-da-yin-ju-zhen-lcof/

面试题30:包含min函数的栈

https://leetcode.cn/problems/bao-han-minhan-shu-de-zhan-lcof/

面试题31:栈的压入、弹出序列

https://leetcode.cn/problems/zhan-de-ya-ru-dan-chu-xu-lie-lcof/

面试题32-1:从上到下打印二叉树

https://leetcode.cn/problems/cong-shang-dao-xia-da-yin-er-cha-shu-lcof/

面试题32-2:从上到下打印二叉树2

https://leetcode.cn/problems/cong-shang-dao-xia-da-yin-er-cha-shu-ii-lcof/

面试题32-3:从上到下打印二叉树3

https://leetcode.cn/problems/cong-shang-dao-xia-da-yin-er-cha-shu-iii-lcof/

面试题33:二叉搜索树的后序遍历序列

https://leetcode.cn/problems/er-cha-sou-suo-shu-de-hou-xu-bian-li-xu-lie-lcof/

面试题34:二叉树中和为某一值的路径

https://leetcode.cn/problems/er-cha-shu-zhong-he-wei-mou-yi-zhi-de-lu-jing-lcof/

面试题35:复杂链表的复制

https://leetcode.cn/problems/fu-za-lian-biao-de-fu-zhi-lcof/

面试题36:二叉搜索树与双向链表

https://leetcode.cn/problems/er-cha-sou-suo-shu-yu-shuang-xiang-lian-biao-lcof/

面试题38:字符串的排列

https://leetcode.cn/problems/zi-fu-chuan-de-pai-lie-lcof/

面试题39:数组中出现次数超过一半的数字

https://leetcode.cn/problems/shu-zu-zhong-chu-xian-ci-shu-chao-guo-yi-ban-de-shu-zi-lcof/

面试题40:最小的k个数

https://leetcode.cn/problems/zui-xiao-de-kge-shu-lcof/

面试题41:数据流中的中位数

https://leetcode.cn/problems/shu-ju-liu-zhong-de-zhong-wei-shu-lcof/

面试题42:连续子数组的最大和

https://leetcode.cn/problems/lian-xu-zi-shu-zu-de-zui-da-he-lcof/

面试题44:数字序列中某一位数字

https://leetcode.cn/problems/shu-zi-xu-lie-zhong-mou-yi-wei-de-shu-zi-lcof/

面试题46:把数字翻译成字符串

https://leetcode.cn/problems/ba-shu-zi-fan-yi-cheng-zi-fu-chuan-lcof/

面试题47:礼物的最大价值

https://leetcode.cn/problems/li-wu-de-zui-da-jie-zhi-lcof/

面试题48:最长不含重复字符的子字符串

https://leetcode.cn/problems/zui-chang-bu-han-zhong-fu-zi-fu-de-zi-zi-fu-chuan-lcof/

面试题49:丑数

https://leetcode.cn/problems/chou-shu-lcof/

面试题50:第一个只出现一次的字符

https://leetcode.cn/problems/di-yi-ge-zhi-chu-xian-yi-ci-de-zi-fu-lcof/

面试题52:两个链表的第一个公共节点

https://leetcode.cn/problems/liang-ge-lian-biao-de-di-yi-ge-gong-gong-jie-dian-lcof/

面试题53-1:在排序数组中查找数字1

https://leetcode.cn/problems/zai-pai-xu-shu-zu-zhong-cha-zhao-shu-zi-lcof/

面试题53-2:0~n-1中缺失的数字

https://leetcode.cn/problems/que-shi-de-shu-zi-lcof/

面试题54:二叉搜索树的第k大节点

https://leetcode.cn/problems/er-cha-sou-suo-shu-de-di-kda-jie-dian-lcof/

面试题55-1:二叉树的深度

https://leetcode.cn/problems/er-cha-shu-de-shen-du-lcof/

面试题55-2:平衡二叉树

https://leetcode.cn/problems/ping-heng-er-cha-shu-lcof/

面试题56-1:数组中数字出现的次数

https://leetcode.cn/problems/shu-zu-zhong-shu-zi-chu-xian-de-ci-shu-lcof/

面试题56-2:数组中数字出现的次数II

https://leetcode.cn/problems/shu-zu-zhong-shu-zi-chu-xian-de-ci-shu-ii-lcof/

面试题57-1:和为s的两个数字

https://leetcode.cn/problems/he-wei-sde-liang-ge-shu-zi-lcof/

面试题57-2:和为s的连续正数序列

https://leetcode.cn/problems/he-wei-sde-lian-xu-zheng-shu-xu-lie-lcof/

面试题58-1:翻转单词顺序

https://leetcode.cn/problems/fan-zhuan-dan-ci-shun-xu-lcof/

面试题58-2:左旋转字符串

https://leetcode.cn/problems/zuo-xuan-zhuan-zi-fu-chuan-lcof/

面试题61:扑克牌中的顺子

https://leetcode.cn/problems/bu-ke-pai-zhong-de-shun-zi-lcof/

面试题63:股票的最大利润

https://leetcode.cn/problems/gu-piao-de-zui-da-li-run-lcof/

面试题64:求1+2+…+n

https://leetcode.cn/problems/qiu-12n-lcof/

面试题65:不用加减乘除做加法

https://leetcode.cn/problems/bu-yong-jia-jian-cheng-chu-zuo-jia-fa-lcof/

面试题66:构建乘积数组

https://leetcode.cn/problems/gou-jian-cheng-ji-shu-zu-lcof/

面试题68-1:二叉搜索树的最近公共祖先

https://leetcode.cn/problems/er-cha-sou-suo-shu-de-zui-jin-gong-gong-zu-xian-lcof/

面试题68-2:二叉树的最近公共祖先

https://leetcode.cn/problems/er-cha-shu-de-zui-jin-gong-gong-zu-xian-lcof/