栈
栈类似于箱子。
静态栈、动态栈。
关于栈的操作
#include
#include
#include
typedef struct Node
{
int data;
struct Node *pNext;
}NODE, *PNODE;
typedef struct Stack
{
PNODE pTop;
PNODE pBottom;
}STACK, *PSTACK;
...
分类:
其他好文 时间:
2014-08-24 16:45:42
阅读次数:
179
数据表大概150M,但是只有几个字段,导致行数特别多,当使用正则表达式去匹配时执行较慢。解决思路:增大map数; //设置reduce数为150,将原表分成150份,map数无法直接设置,因为和输入文件数和文件大小等几个参数决定set mapred.reduce.tasks = 150;//在map...
分类:
其他好文 时间:
2014-08-24 14:11:33
阅读次数:
390
· 当对象的类型不影响类中函数的行为时,就要使用模板来生成这样一组类。· 当对象的类型影响类中函数的行为时,就要使用继承来得到这样一组类。下面的代码通过定义一个链表来实现Stack类,假设堆栈的对象类型为T:templateclass stack{public: stack(); ~st...
分类:
其他好文 时间:
2014-08-24 14:05:52
阅读次数:
179
题目链接After completing her final semester, Savita is back home. She is excited to meet all her friends. HerNfriends live in different houses spread acro...
分类:
其他好文 时间:
2014-08-24 11:29:42
阅读次数:
327
1 //动态数组 2 vector theVector; 3 theVector.push_back(1); 4 theVector.push_back(2); 5 theVector.push_back(3); 6 theVector.pop_ba...
分类:
其他好文 时间:
2014-08-24 09:08:02
阅读次数:
136
通常认为,性能的改进是90 ~ 10 规则, 即10%的代码要对90%的性能问题负责。做过大型软件工程的程序员一般都知道这个概念
分类:
编程语言 时间:
2014-08-24 05:55:43
阅读次数:
256
问题:有时候有一些DOS命令需要我们在执行程序的时候调用,这需要使用C#提供的相关接口。
代码如下,很简单,相信大家都能看懂,我就不赘述了。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Syste...
About Ruby on RailsRuby on Rails is an application stack that provides developers with a framework to quickly create a variety of web applications. Ru...
分类:
其他好文 时间:
2014-08-23 13:55:20
阅读次数:
193
括号配对是最基本的栈的问题,它是栈入门的经典题目,思路是,如果是左括号直接进栈,如果是右括号,这时就要比较栈顶的元素与他是否匹配,如果匹配则出栈,否则进栈,下面是代码的实现: 1 #include 2 #include 3 typedef struct stack{//定义栈来存储括号 4 ...
分类:
其他好文 时间:
2014-08-23 13:52:40
阅读次数:
221
DescriptionHow far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We'...
分类:
其他好文 时间:
2014-08-23 01:00:19
阅读次数:
238