
算法
文章平均质量分 87
strive_or_die
谦虚学习,好好生活。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
生成窗口最大值数组
有一个整形数组arr和一个大小为w的窗口从数组的最左边滑到最右边,窗口每次向右边滑一个位置。 例如,数组为【3,4,1,3,5,3,6】,窗口大小为3时: [3,4,1[,3,5,3,6 窗口中最大值为4 3,[4,1,3[,5,3,6 窗口中最大值为4 3,4,[1,3,5],3,6 窗口中最大值为5 3,4,1,[3,5,3],6 窗口中最大值为5 3,4,1,3,[5...原创 2019-12-16 21:14:22 · 195 阅读 · 0 评论 -
用一个栈实现另外一个栈的排序
一个栈中的元素都是整形,现在想要将该栈从顶到底按从大到小的顺序排序,只许申请一个栈。除此之外,可以申请新的变量,但是不能申请额外的数据结构。如何实现排序? import java.util.Stack; public class SortStackByStack { public static void main(String[] args) { Stack<In...原创 2019-12-16 20:16:35 · 226 阅读 · 0 评论 -
求最长不重复字符串-源码
Given a string, find the length of thelongest substringwithout repeating characters. Examples: Given"abcabcbb", the answer is"abc", which the length is 3. Given"bbbbb", the answer is"b",...原创 2017-09-05 21:37:36 · 706 阅读 · 0 评论