突击春招:解密面试官的算法题集合
引言
秋招已经过去,春招季节即将到来,对于寻找工作的求职者来说,面试是一个非常重要的环节。而在技术面试中,算法题往往是最常见且最具挑战性的部分。本文将为大家整理一些常见的算法题目,在这里不会给出详细的解题思路和代码实现,希望大家自行去 leetcode 上实现。
leetcode
简单
两数之和
链接:https://leetcode.cn/problems/two-sum/description/
合并两个有序数组
链接:https://leetcode.cn/problems/merge-sorted-array/
螺旋遍历二维数组
链接:https://leetcode.cn/problems/shun-shi-zhen-da-yin-ju-zhen-lcof/description/
有效的括号
链接:https://leetcode.cn/problems/valid-parentheses/description/
买卖股票的最佳时机
链接:https://leetcode.cn/problems/best-time-to-buy-and-sell-stock/description/
最长公共前缀
链接:https://leetcode.cn/problems/longest-common-prefix/description/
存在重复元素
链接:https://leetcode.cn/problems/contains-duplicate/description/
相同的树
链接:https://leetcode.cn/problems/same-tree/description/
合并两个有序链表
链接:https://leetcode.cn/problems/merge-two-sorted-lists/description/
按奇偶排序数组
链接:https://leetcode.cn/problems/sort-array-by-parity/description/
环形链表
链接:https://leetcode.cn/problems/linked-list-cycle/description/
返回倒数第 k 个节点
链接:https://leetcode.cn/problems/kth-node-from-end-of-list-lcci/description/
二叉树的最近公共祖先
链接:https://leetcode.cn/problems/er-cha-shu-de-zui-jin-gong-gong-zu-xian-lcof/description/
最长公共前缀
链接:https://leetcode.cn/problems/longest-common-prefix/description/
二叉树的直径
链接:https://leetcode.cn/problems/diameter-of-binary-tree/description/
合并两个有序数组
链接:https://leetcode.cn/problems/merge-sorted-array/
相交链表
链接:https://leetcode.cn/problems/intersection-of-two-linked-lists/
数据流中的第 K 大元素
链接:https://leetcode.cn/problems/kth-largest-element-in-a-stream/description/
最长回文串
链接:https://leetcode.cn/problems/longest-palindrome/description/
反转字符串
链接:https://leetcode.cn/problems/reverse-string/description/
字符串中的单词反转
链接:https://leetcode.cn/problems/fan-zhuan-dan-ci-shun-xu-lcof/description/
中等
三数之和
链接:https://leetcode.cn/problems/3sum/description/
全排列
链接:https://leetcode.cn/problems/permutations/
加油站
链接:https://leetcode.cn/problems/gas-station/description/
买卖股票的最佳时机 II
链接:https://leetcode.cn/problems/best-time-to-buy-and-sell-stock-ii/description/
岛屿数量
链接:https://leetcode.cn/problems/number-of-islands/description/
最长递增子序列
链接:https://leetcode.cn/problems/longest-increasing-subsequence/description/
招式拆解 I
链接:https://leetcode.cn/problems/zui-chang-bu-han-zhong-fu-zi-fu-de-zi-zi-fu-chuan-lcof/description/
岛屿的最大面积
链接:https://leetcode.cn/problems/ZL6zAn/description/
字符串转换整数 (atoi)
链接:https://leetcode.cn/problems/string-to-integer-atoi/description/
最大数
链接:https://leetcode.cn/problems/largest-number/description/
移掉 K 位数字
链接:https://leetcode.cn/problems/remove-k-digits/description/
整数反转
链接:https://leetcode.cn/problems/reverse-integer/description/
前 K 个高频元素
链接:https://leetcode.cn/problems/top-k-frequent-elements/description/
二叉树最大宽度
链接:https://leetcode.cn/problems/maximum-width-of-binary-tree/description/
括号生成
链接:https://leetcode.cn/problems/generate-parentheses/description/
重排链表
链接:https://leetcode.cn/problems/reorder-list/description/
合并区间
链接:https://leetcode.cn/problems/merge-intervals/description/
无重复字符的最长子串
链接:https://leetcode.cn/problems/longest-substring-without-repeating-characters/description/
最大子数组和
链接:https://leetcode.cn/problems/maximum-subarray/description/
最长公共子序列
链接:https://leetcode.cn/problems/longest-common-subsequence/description/
复杂
滑动窗口最大值
链接:https://leetcode.cn/problems/sliding-window-maximum/description/
二叉树的序列化与反序列化
链接:https://leetcode.cn/problems/serialize-and-deserialize-binary-tree/
K 个一组翻转链表
链接:https://leetcode.cn/problems/reverse-nodes-in-k-group/description/
结语
本文从 leetcode 100 、网上面经、以及个人作为面试官、面试者经历所写。大家可以收藏,提前学习。祝大家春招顺利,找到心仪的工作!添加本人微信获取更全的版本 PDF 文件,PDF 版本会有一些题目没有出现在 leetcode 上的。