首页 存档 技术 查看内容

资源 | 从算法到数据结构,百道面试问题实现答案集合

2018-3-30 13:00 |来自: 互联网 294 0

摘要: 选自GitHub 作者:Sherali Obidov 机器之心编译 参与:李亚洲、微胖、蒋思源 该资源是算法、数据结构以及面试问题解决方案的集合,里面的 repository 包含了我对常见算法问题的解答以及数据结构的实现(用 Java)。 ...

选自GitHub

作者:Sherali Obidov

机器之心编译

参与:李亚洲、微胖、蒋思源


该资源是算法、数据结构以及面试问题解决方案的集合,里面的 repository 包含了我对常见算法问题的解答以及数据结构的实现(用 Java)。该资源集合处于持续更新中。


项目地址:https://github.com/sherxon/AlgoDS


目前为止,该资源集合提供了算法、数据结构以及 200 道面试题的答案。


问题


问题被分成了三个等级:


  • 简单问题:http://suo.im/262F7q

  • 中等问题:http://suo.im/11JBcd

  • 困难问题:http://suo.im/3pTT1R


问题方向


针对以下不同面试问题,各自的链接中都给出了解决方案。


阵列(Arrays)


  1. 旋转阵列(Rotate Array):http://suo.im/2Z3CMz

  2. Contains Duplicate:http://suo.im/2E9xnW

  3. 发现峰值元素:http://suo.im/4gQO3k

  4. 最大化子阵列(Maximum Subarray):http://suo.im/N0TXd

  5. 阵列中第 k 最大的元素(Kth Largest Element in an Array):http://suo.im/2P7aIi

  6. 搜索阵列中的所有 Duplicates:http://suo.im/2wQwpw

  7. 最长增长子序列(Longest Increasing Subsequence):http://suo.im/PvJyK

  8. 旋转图像、矩阵(Rotate Image, matrix):http://suo.im/3BGG1x

  9. 搅乱阵列(Shuffle an Array):http://suo.im/3V5MBe

  10. 在旋转阵列中搜索最小值:http://suo.im/2xtLa0

  11. 在旋转阵列中搜索:http://suo.im/1Ued08


链表(linked list)


  1. 单链表实现:http://suo.im/2n3Kzr

  2. 双向链表实现(Doubly Linked List):http://suo.im/1y98CP

  3. 删除链表中的结点:http://suo.im/41ZByL

  4. 回文链表(Palindrome Linked List):http://suo.im/3OWugt

  5. 反向链表(Reverse Linked List):http://suo.im/OxjXQ

  6. 两个链表的交集点(Intersection of Two Linked Lists):http://suo.im/36rPzZ

  7. 链表循环:http://suo.im/gANC2

  8. 从表的底部一处 Nth 节点:http://suo.im/4D3RNj

  9. 合并分类链表(Merge Sort List):http://suo.im/4jAMx3

  10. 发现链表循环:http://suo.im/2UFfZI

  11. 合并 k 分类列表:http://suo.im/4uWyyt

  12. 其他有关列表的问题:http://suo.im/4TyiJ


二叉树(Binary Tree)


  1. 二叉树的层次遍历(Binary Tree Level Order Traversal):http://suo.im/1DRKTK

  2. 左叶节点求和(Sum of Left Leaves):http://suo.im/nZnDk

  3. 二叉树转置(Invert Binary Tree): http://suo.im/27dXUu

  4. 二叉搜索树迭代器(Binary Search Tree Iterator):http://suo.im/4EgmWR

  5. 二叉树后序遍历(Binary Tree Postorder Traversal):http://suo.im/2I6r5S

  6. 二叉树前序遍历(Binary Tree Preorder Traversal):http://suo.im/1AF5J0

  7. 平面化二叉树为链表(Flatten Binary Tree to Linked List):http://suo.im/46kRsP

  8. 对称树(Symmetric Tree):http://suo.im/BnxLJ

  9. 二叉树中序遍历(Binary Tree Inorder Traversal):http://suo.im/snOMr

  10. 相似树(Same Tree):http://suo.im/1OCC7W

  11. 二叉树最大深度(Maximum Depth of Binary Tree):http://suo.im/2KinyW

  12. 平衡二叉树(Balanced Binary Tree):http://suo.im/3goksD

  13. 二叉树最小深度(Minimum Depth of Binary Tree):http://suo.im/2f53cs

  14. 平衡二叉搜索树排序列表(Sorted List to Balanced Binary Search Tree):http://suo.im/2D1MAo

  15. 验证二叉搜索树(Validate Binary Search Tree):http://suo.im/1lkBnt

  16. 平衡搜索树排序列表(Sorted List to Balanced BST):http://suo.im/2Qr9IL

  17. 平衡搜索树第 k 最小元素(Kth Smallest Element in a BST):http://suo.im/4mwq7K

  18. 二叉树的之字形层序遍历(Binary Tree Zigzag Level Order Traversal):http://suo.im/3NCvZW

  19. 平衡搜索树的结点删除(Delete Node in a BST):http://suo.im/1cXcP3

  20. 平衡树的最小公共祖先(Lowest Common Ancestor of BST):http://suo.im/MBljD

  21. 二叉树的左视图(Binary Tree Left Side View):http://suo.im/1hzBvx

  22. 二叉树的右视图(Binary Tree Right Side View):http://suo.im/2Invga

  23. 平衡搜索树的众数(Mode in BST):http://suo.im/3Jyrn2

  24. 最高频率子树和(Most Frequent Subtree Sum):http://suo.im/35LlcZ

  25. 搜寻每行最大元素(Find Largest Element in Each Row):http://suo.im/32twya


其他树型问题:http://suo.im/4TyiJ


数学


  1. 整数拆分(Integer Break):http://suo.im/lJU8r

  2. 逆位(Reverse Bits):http://suo.im/2E075a

  3. 回文数:(Palindrome Number):http://suo.im/3pkhnt

  4. 幂(Math.pow):http://suo.im/1Wr3E9

  5. 壶和水的问题(Jug and Water Problem):http://suo.im/1gWPQG

  6. 爱拉托逊新筛法(Sieve of Eratosthenes):http://suo.im/Pi0G7

  7. 费马素数(Fermat's primality):http://suo.im/2HZFT3

  8. 评估逆波兰式表示法(Evaluate Reverse Polish Notation):http://suo.im/jIGg6


堆栈

声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

相关分类

返回顶部