选自GitHub
作者:Sherali Obidov
机器之心编译
参与:李亚洲、微胖、蒋思源
该资源是算法、数据结构以及面试问题解决方案的集合,里面的 repository 包含了我对常见算法问题的解答以及数据结构的实现(用 Java)。该资源集合处于持续更新中。
项目地址:https://github.com/sherxon/AlgoDS
目前为止,该资源集合提供了算法、数据结构以及 200 道面试题的答案。
问题
问题被分成了三个等级:
简单问题:http://suo.im/262F7q
中等问题:http://suo.im/11JBcd
困难问题:http://suo.im/3pTT1R
问题方向
针对以下不同面试问题,各自的链接中都给出了解决方案。
阵列(Arrays)
旋转阵列(Rotate Array):http://suo.im/2Z3CMz
Contains Duplicate:http://suo.im/2E9xnW
发现峰值元素:http://suo.im/4gQO3k
最大化子阵列(Maximum Subarray):http://suo.im/N0TXd
阵列中第 k 最大的元素(Kth Largest Element in an Array):http://suo.im/2P7aIi
搜索阵列中的所有 Duplicates:http://suo.im/2wQwpw
最长增长子序列(Longest Increasing Subsequence):http://suo.im/PvJyK
旋转图像、矩阵(Rotate Image, matrix):http://suo.im/3BGG1x
搅乱阵列(Shuffle an Array):http://suo.im/3V5MBe
在旋转阵列中搜索最小值:http://suo.im/2xtLa0
在旋转阵列中搜索:http://suo.im/1Ued08
链表(linked list)
单链表实现:http://suo.im/2n3Kzr
双向链表实现(Doubly Linked List):http://suo.im/1y98CP
删除链表中的结点:http://suo.im/41ZByL
回文链表(Palindrome Linked List):http://suo.im/3OWugt
反向链表(Reverse Linked List):http://suo.im/OxjXQ
两个链表的交集点(Intersection of Two Linked Lists):http://suo.im/36rPzZ
链表循环:http://suo.im/gANC2
从表的底部一处 Nth 节点:http://suo.im/4D3RNj
合并分类链表(Merge Sort List):http://suo.im/4jAMx3
发现链表循环:http://suo.im/2UFfZI
合并 k 分类列表:http://suo.im/4uWyyt
其他有关列表的问题:http://suo.im/4TyiJ
二叉树(Binary Tree)
二叉树的层次遍历(Binary Tree Level Order Traversal):http://suo.im/1DRKTK
左叶节点求和(Sum of Left Leaves):http://suo.im/nZnDk
二叉树转置(Invert Binary Tree): http://suo.im/27dXUu
二叉搜索树迭代器(Binary Search Tree Iterator):http://suo.im/4EgmWR
二叉树后序遍历(Binary Tree Postorder Traversal):http://suo.im/2I6r5S
二叉树前序遍历(Binary Tree Preorder Traversal):http://suo.im/1AF5J0
平面化二叉树为链表(Flatten Binary Tree to Linked List):http://suo.im/46kRsP
对称树(Symmetric Tree):http://suo.im/BnxLJ
二叉树中序遍历(Binary Tree Inorder Traversal):http://suo.im/snOMr
相似树(Same Tree):http://suo.im/1OCC7W
二叉树最大深度(Maximum Depth of Binary Tree):http://suo.im/2KinyW
平衡二叉树(Balanced Binary Tree):http://suo.im/3goksD
二叉树最小深度(Minimum Depth of Binary Tree):http://suo.im/2f53cs
平衡二叉搜索树排序列表(Sorted List to Balanced Binary Search Tree):http://suo.im/2D1MAo
验证二叉搜索树(Validate Binary Search Tree):http://suo.im/1lkBnt
平衡搜索树排序列表(Sorted List to Balanced BST):http://suo.im/2Qr9IL
平衡搜索树第 k 最小元素(Kth Smallest Element in a BST):http://suo.im/4mwq7K
二叉树的之字形层序遍历(Binary Tree Zigzag Level Order Traversal):http://suo.im/3NCvZW
平衡搜索树的结点删除(Delete Node in a BST):http://suo.im/1cXcP3
平衡树的最小公共祖先(Lowest Common Ancestor of BST):http://suo.im/MBljD
二叉树的左视图(Binary Tree Left Side View):http://suo.im/1hzBvx
二叉树的右视图(Binary Tree Right Side View):http://suo.im/2Invga
平衡搜索树的众数(Mode in BST):http://suo.im/3Jyrn2
最高频率子树和(Most Frequent Subtree Sum):http://suo.im/35LlcZ
搜寻每行最大元素(Find Largest Element in Each Row):http://suo.im/32twya
其他树型问题:http://suo.im/4TyiJ
数学
整数拆分(Integer Break):http://suo.im/lJU8r
逆位(Reverse Bits):http://suo.im/2E075a
回文数:(Palindrome Number):http://suo.im/3pkhnt
幂(Math.pow):http://suo.im/1Wr3E9
壶和水的问题(Jug and Water Problem):http://suo.im/1gWPQG
爱拉托逊新筛法(Sieve of Eratosthenes):http://suo.im/Pi0G7
费马素数(Fermat's primality):http://suo.im/2HZFT3
评估逆波兰式表示法(Evaluate Reverse Polish Notation):http://suo.im/jIGg6
堆栈 |