- 博客(3)
- 收藏
- 关注
转载 插入排序算法
1、插入排序插入排序(Insertion Sort)是一种简单直观的排序算法。它的工作原理是通过构建有序序列,对于未排序数据,在已排序序列中从后向前扫描,找到相应位置并插入。插入排序在实现上,通常采用in-place排序(即只需用到O(1)的额外空间的排序),因而在从后向前扫描过程中,需要反复把已排序元素逐步向后挪位,为最新元素提供插入空间。时间复杂度:O(n^2); 动画演示 ...
2019-10-05 08:03:21
679
转载 求解逆波兰表达式的值
题目: Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2", "1", "...
2019-10-05 08:03:19
137
转载 二叉树的最小深度
题目: Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. 思路: 树的操作首先想到的方法是用递归,大致思路是: 若...
2019-10-05 08:03:17
88
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人