码迷,mamicode.com
首页 >  
搜索关键字:stack    ( 9691个结果
(easy)LeetCode 225.Implement Stack using Queues
Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top()...
分类:其他好文   时间:2015-07-30 21:06:04    阅读次数:113
数据结构复习之用两个栈模拟队列操作
#include #include#include#include#define MAXSIZE 100using namespace std;struct Stack{ int s[MAXSIZE]; int top=0; bool stackOverFlow(){ ...
分类:其他好文   时间:2015-07-30 21:04:10    阅读次数:118
[VBS]脚本中的字典、动态数组、队列和堆栈
今天用VBS脚本写了几个程序,用到了字典(Dictionary)、动态数组(ArrayList)、队列(Queue)和堆栈(Stack)。现在写篇Blog总结一下 :-)1.编写环境今天突发奇想下载了个gVim来写VBS脚本,我用的版本是7.4的在写脚本前,需要在gVim的安装根目录下,找到文件“_...
分类:编程语言   时间:2015-07-30 18:30:12    阅读次数:236
我的Android进阶之旅------>Android关于Activity管理的一个简单封装
如何管理当前的运行Activity栈,如何彻底退出程序,本文封装了一个Activity管理类,可以方便随时退出程序。 import java.util.Stack; import android.app.Activity; import android.content.Context; public class ActivityManager { private static Stack...
分类:移动开发   时间:2015-07-30 13:34:25    阅读次数:118
栈和堆的区分
栈和堆的区别一、程序所占内存分类版本一转于大家论坛C/C++编译的程序占用的内存分类:1、栈区(stack)------由编译器自动分配释放,存放函数的参数值,局部变量的值等。其操作方式类似于数据结构中的栈(属于后进先出的方式)。2、堆区(heap)------一般由程序员分配释放,若程序员不释放,...
分类:其他好文   时间:2015-07-30 11:05:42    阅读次数:118
非递归二叉树遍历
算法导论:10.4-3给定一个 n 二叉树结点,写一个 O(n) 非递归处理时间,树中的每个节点keyword出口。堆栈可以用作辅助数据结构。堆栈实现参考这里。#ifndef _BINARY_TREE_USE_STACK_H_#define _BINARY_TREE_USE_STACK_H_/***...
分类:其他好文   时间:2015-07-30 08:16:44    阅读次数:158
In order to use an interrupt in a Cortex-M3/M4, you need the following
a stack. The core automatically saves several registers on the stack when an interrupt fires. Initial stack pointer value is read from address 0x0 the...
分类:Windows程序   时间:2015-07-29 22:55:38    阅读次数:194
20.Valid Parentheses (Stack)
Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ...
分类:其他好文   时间:2015-07-29 22:45:22    阅读次数:142
CodeForces 5C Longest Regular Bracket Sequence
题意:给定一串括号,求最长的规则('(())'或‘(()())’)的字串及最长字串的个数;思路:使用栈保存左括号,与最近的右括号匹配,使用递推推出每个位置最长字串长度;#include#include#include#include#includeusing namespace std;stack ...
分类:其他好文   时间:2015-07-29 21:05:20    阅读次数:91
C#中Stack<T>类的使用及部分成员函数的源码分析
Stack类 StackT> 作为数组来实现。 StackT> 的容量是 StackT> 可以包含的元素数。 当向 StackT> 中添加元素时,将通过重新分配内部数组来根据需要自动增大容量。 可通过调用 TrimExcess 来减少容量。 如果 Count 小于堆栈的容量,则 Push 的运算复杂度是 O(1)。 如果需要增加容量以容纳新元素,则 Push 的运算复杂度成为 O(n),...
分类:Windows程序   时间:2015-07-29 17:15:52    阅读次数:214
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!