/***************************** Date :2015-07-20* Description:stack.h*****************************/#ifndef _STACK_H#define _STACK_Htemplateclass Stack{...
分类:
编程语言 时间:
2015-07-20 12:26:01
阅读次数:
98
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get ...
分类:
其他好文 时间:
2015-07-20 09:16:26
阅读次数:
96
#include
#include
#include
using namespace std;
int fun(int a,int b){
int c = 0;
int d = 1;
stack st;
while(b){
st.push(b & 1);
b >>= 1l;
}
while(!st.empty()){
int t = st.top();
st.p...
分类:
其他好文 时间:
2015-07-19 18:14:03
阅读次数:
120
从整个基础架构的层次结构上将,WCF可以分为服务模型层(Service Model Layer)和信道层(Channel Layer)两个层次。服务模型层建立在信道层之上,提供了一个统一的。可扩展的编程模型;而信道层通过信道栈(Channel Stack)实现对消息的传输和处理。3.1 信道与信道栈...
分类:
其他好文 时间:
2015-07-19 16:20:09
阅读次数:
133
对于数据结构这方面来说,重点就是二叉树的遍历等操作,所有的问题基本都是集中在这里,先说一个二叉树的循环遍历的方法:vector preOrderTraversal(TreeNode *head){ vector result; const TreeNode *p; stack s; p = head...
分类:
其他好文 时间:
2015-07-18 19:49:22
阅读次数:
97
栈的概念 栈(stack)是限定只能在表尾进行插入和删除操作的线性表。 栈又称为后进先出(Last In First Out)的线性表,简称LIFO结构。 允许插入和删除的一段称为栈顶(top),另一端称为栈底(bottom),不含任何数据元素的栈称为空栈。 栈的插入操作,叫做进栈,也称压栈...
分类:
其他好文 时间:
2015-07-17 20:53:41
阅读次数:
112
比较全局变量、全局静态变量、局部变量、局部静态变量的区别,他们在编译完后存储位置在什么地方、初始化值在什么地方、内存什么时候分配、赋初值对这些变量有哪些影响等。要弄清楚这些问题,首先要弄清楚下面几个知识点。C语言分下面几个存储区:1、栈区(stack)由编译器在需要的时候自动分配释放,在不需要的时候...
分类:
其他好文 时间:
2015-07-17 20:23:37
阅读次数:
123
1.线程的概念:线程和进程有一定的相似性,通常称为轻量级的进程同一进程中的多条线程将共享该进程中的全部系统资源,如虚拟地址空间,文件描述符和信号处理等等。但同一进程中的多个线程都有自身控制流(它自己的指令计数器和cpu时钟)和各自的调用栈(call stack),自己的寄存器环境(register ...
分类:
编程语言 时间:
2015-07-17 11:55:15
阅读次数:
142
232 Implement Queue using Stacks用2个stack 完成 代码如下class Queue: # initialize your data structure here. def __init__(self): self.stackA = [] ...
分类:
其他好文 时间:
2015-07-17 09:36:59
阅读次数:
124
先序遍历
void PreOrder_Nonrecursive1(BiTree T) //先序遍历的非递归
{
if(!T)
return ;
stack s;
BiTree curr = T;
while(curr != NULL || !s.empty())
{
while(...
分类:
其他好文 时间:
2015-07-17 08:25:49
阅读次数:
131