![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法题 / leetcode
文章平均质量分 65
Zpeg
暂无
展开
-
1. minimum-depth-of-binary-tree 二叉树的最小深度
题目描述Given a binary tree, find its minimum depth.The minimum depth is thenumber of nodes along the shortest path from the root node down to thenearest leaf node.给定一个二叉树,找到它的最小深度,最小深度是从根节点到最近叶节点的最短路原创 2017-10-28 09:20:04 · 226 阅读 · 0 评论 -
2. evaluate-reverse-polish-notation 后缀表达式的求解
题目描述Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are+,-,*,/. Each operand may be an integer or another expression给定一个后缀表达式(逆波兰式),求解答案题目解析这个题原创 2017-11-01 16:40:45 · 305 阅读 · 0 评论 -
4. sort-list 链表排序
题目描述Sort a linked list in O(n log n) time using constant space complexity.单向链表排序,要求时间复杂度为O(n log n),空间复杂度为O(1)。题目解析第一次看到链表排序,往往链表在插入的时候就已经排序好了,不需要写额外的排序的程序。既然是排序,总也离不开排序算法,像冒泡排序、堆排序、归并排序、快速排原创 2018-05-23 13:23:40 · 857 阅读 · 0 评论 -
3.max-points-on-a-line 直线上的最多点
题目描述Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.给定一个二维平面上的n个点,找到一条直线上面的点最多,求得这个直线上的点的数目题目解析这个题目如果用暴力遍历的想法去做,本身并不难思考,难点在于将各种情况都考虑好。原创 2017-11-02 14:49:53 · 551 阅读 · 0 评论 -
5. insertion-sort-list 链表插入排序
题目描述Sort a linked list using insertion sort.对一个链表进行插入排序题目解析上一道题对链表进行归并排序和冒泡排序 详细可见https://blog.csdn.net/qq_28351465/article/details/78500992对链表进行插入排序,依次对链表进行遍历,遍历到哪个节点,哪个节点之前的全部节点是已排序好的,然后再依次访问已排序好的节点...原创 2018-06-07 19:29:50 · 202 阅读 · 0 评论 -
6. binary-tree-postorderTraversal 二叉树后序遍历
题目描述Given a binary tree, return the postorder traversal of its nodes' values.对给定二叉树后序遍历题目解析二叉树的后序遍历,网上很很多文章写得很好,这里不在赘述,可以用递归和遍历两个方法解决。方法一:递归方法代码如下/** * Definition for binary tree * stru...原创 2018-10-24 14:36:35 · 293 阅读 · 0 评论