g**w 发帖数: 969 | 1 I think your code couldn't tell whether stack growing downward or not. in
main() function frame, it cut enough from stack for local variable, but it's
up to compiler to assign them to variables, which order doesn't matter.
you can try this: call another function from main, in that function print
out the address of variables, they should be lower than main()'s.
another one: heap & stack usually are just residing in two memory segments,
they are not related at all. only in old days, such as the p... 阅读全帖 |
|
b******7 发帖数: 92 | 2 注意左移右移就行了
第一个栈[0...capacity0 - 1)
第二、三个栈[capacity0,...,N)分别一个从头开始++,一个从尾开始--
当第一个栈满而第二、三个栈不满时,做右移操作
反过来,但第二、三个栈满,而第一个栈伟满时,做左移操作
template
class TripleStack{
public:
TripleStack()
{
head0 = 0;
head1 = capacity0 = N/3;
head2 = N-1;
}
void push0(const T & e)
{
if(!isSubStackFull(0))
arr[head0++] = e;
else if(!isSubStackFull(1))
{
shiftRight();
arr[head0++] = e;
}
... 阅读全帖 |
|
m*********a 发帖数: 3299 | 3 不喜欢这种不直观的很难看懂的写法
你在遇到),准备pop的时候,看一下stack上对应位置是不是(
如果是,就pop,不是就push
最大值,就是当前i-pop后stack的index+1或i+1 when stack is empty.
来。 |
|
m*********a 发帖数: 3299 | 4 其实反过来写就跟清楚了
如果stack不空的化,
if (s[i]=='(' and s[stack.top()]==')')
container.pop();
length=container.empty()?i+1:i-container.top();
if (length>max_length) max_length=length;
其他的所有情况push stack |
|
h*******e 发帖数: 1377 | 5 你写得挺好啊,我之前自己实现 atoi 了~~~ 还有自己写 intToStr了~~~ 看过你的发
现这些都不用啊, 代码由50多行缩到了25行 。正常四则运算的如果不带括号的就直接
一个stack就行, 如果带括号的需要2个stack 一个放 符号,一个放 数字。。带括号的
情况还挺复杂~~ 带括号的我还不会 提笔就写~~ 没怎么练过, 不带括号的倒是简单
一点。
我把我照你的改的也给贴上
class Solution {
public:
int evalRPN(vector &tokens) {
stack numStack;
for(int tokI = 0; tokI < tokens.size(); ++ tokI)
if(tokens[tokI] == "*" || tokens[tokI] == "+" || tokens[tokI] ==
"/" || tokens[tokI] == "-")
{
int val1 = numStac... 阅读全帖 |
|
g********r 发帖数: 89 | 6 Leetcode给的solution,在pop的时候,只要栈顶元素=minStack栈顶元素,就把
minStack的栈顶元素pop掉。如果有duplicates的话,比如stack里面5, 3, 3,
minStack里面是5, 3,在pop第一个3的时候,不应该把minStack里面的3 pop掉吧。否
则Stack里面变成了5, 3, minStack里面是5, 答案是不是有问题?
---- Leetcode solution
public void pop() {
if (stack.pop().equals(minStack.peek())) minStack.pop();
}
-----my solution
void pop() {
if(stk.empty()) return;
int tmp=stk.top();
stk.pop();
if(stk.empty() || (tmp == min_stk.top() && stk.top() > min_stk.top... 阅读全帖 |
|
F********y 发帖数: 400 | 7 土木转行过来的新人,下面都是我的想法,有错莫喷:
第一次轮流pop1个到两个stack里,然后merge回1号stack,因为merge操作,1号里每两
个元素彼此sorted。
第二次轮流pop2个到两个stack里,然后merge,结果1号里每四个元素彼此sorted。
然后循环直到pop数超过n/2,然后最后一次merge回去就结束了。 |
|
z****e 发帖数: 54598 | 8 如果是backend的话
java -> tomcat/jdbc/db(sql) -> spring/hibernate -> nosql/spark/flink/lucene
-> vert.x/netty/core java
差不多酱紫,虽然最后一步比倒数第二步数学要容易点,但是更迟出来
所以如果是学习的话,那就把最后两个颠倒一下
到了spark之后,就明显感觉数学要求陡然升高,高等数学就开始来了
第一步就是线性代数
一般的web也就是到tomcat这个level吧
很多full stack其实就是front end
无非php -> ror -> node酱紫一路过来
除了web还是web,无非换个写法而已,没啥大区别
真的full stack应该从swift -> java,像搞tableau/palantir一样搞法
那才叫真正的full stack,如果搞这种的话,java就直接跳到最后一步了
至少上netty了,现在可以上vert.x
netty作者是韩国人,也是游戏爱好者,本来初衷就是给网游用的
netty那几个core developers,基本上都在各个大公司做顾问... 阅读全帖 |
|
发帖数: 1 | 9 Title: Senior Software Engineer - Full Stack
Work type: full time
Location: Palo Alto
base Salary : 160k-180k + bonus + stock option
Senior Software Engineer - Full Stack
What You'll Do:
• Meteor: We can iterate quickly using Meteor. We can get a highly
responsive and production ready application within days rather than weeks
using Meteor stack.
• Kubernetes and docker: We are in charge of our infrastructure.
What is able to run on our laptops can also run in production
̶... 阅读全帖 |
|
m********u 发帖数: 3942 | 10 【 以下文字转载自 JobHunting 讨论区 】
发信人: missingyou (miss), 信区: JobHunting
标 题: Web Software Engineer (Full Stack) - AI Product
发信站: BBS 未名空间站 (Sun Mar 12 21:07:16 2017, 美东)
有兴趣的同学站内或者发邮件联系 [email protected]/* */
The Research center, headquartered in Silicon Valley, is looking for
software engineers with strong experience in developing software products
and services. Our team's mission is to develop hard AI technologies that
enable us to impact hundreds of millions of users. As a software enginee... 阅读全帖 |
|
c**2 发帖数: 8496 | 11 better set up regular hookup at garage.
stack machine (combo) are not as good as separated washer/dryer because
washer is too small (<3.5cu ft is too small).
as for decking two separated machines, I only saw people do it with front
load washer.
mostly stacked combo are US brands (whirlpool or GE related)
http://www.lowes.com/Appliances/Washers-Dryers/Stacked-Laundry- |
|
m********u 发帖数: 3942 | 12 有兴趣请站内或者邮件 [email protected]
Our client is is looking for talented Senior Full Stack Software Development
Engineers for supporting product development and advanced R&D innovations
of services in the cloud.
The lab urgently needs senior full stack software development engineers who
are passionate about state-of-art big data platform technologies and
applications, and want to take on critical changes to create some world-
first solutions.
Depending on the experience and technical skills, the ... 阅读全帖 |
|
H******S 发帖数: 6011 | 13 前两天版上有兄弟要买1911,我正好也在看,就顺口说了下Para的Double Stack 1911
。Hetzer老大提醒下握把有可能太粗的问题。今天在做IDPA训练的时候,有幸同组的一
个正好有这把。训练结束完后,我问他借来握在手里试试。Para的双层弹夹握把就算对
手相对比较小的我说也绝对没有问题。而我抓lw101老大的P226 MK25 9mm的握把都觉得
大。我打过同样是Double stack .45acp的Glock 21SF,Para的Double stack握把比已
经SF的Glock 21感觉上还要薄得多。
不过如果要买这把的话,不爽的事是自己还要做很多升级。首先在今早5个小时的训练
时,这把Para有4,5次出现FTF。每当出现FTF的时候,Slide都是Locked back,但是
Drop magazine后,magazine里都还有最后一颗子弹。因为IDPA规则,装有子弹的弹夹
绝对不能掉到地上,所以如果是个正规比赛,这位老兄就要被判失去比赛资格(DQ)。这
位老兄说回去要好好研究是同一个弹夹出问题,还是枪本身的问题。另外这位老兄说这
Para的塑料扳机很烂... 阅读全帖 |
|
p******o 发帖数: 1 | 14 STACK ON 枪柜是AMAZON上畅销的一款物美价廉的家用保险箱。它也是得到CA洲政府认
证的枪柜。想必有些枪友家里也会使用。可是只要看看YOUTUBE上的各类介绍,就会发
现STACKON SAFE 是非常不安全的。典型的几个VDEO如下:
STACK ON SAFE的型号很多,不过不同型号的设计大同小异。总结起来,最简单的非法
打开保险箱的方式有PICK备用机械锁和利用震动开锁。下面介绍一下通过改动增强
STACK ON SAFE安全性的方法。
打开保险箱,拆开保险箱门后面的盖板,能看见如下图的结构。
https://imageshack.com/i/nechzqj
一个线路板接受用户通过键盘输入的密码,控制电磁铁(红框内)的通电和断开。电磁
铁中心的锁栓(红箭头指向)。锁栓下降,就可开保险箱门。
下图是备用机械锁的结构,钥匙锁内部的一个拨片,可向下按下电磁铁中心的锁栓。拆
去此拨片,即可取消机械锁,使窃贼无从下手。
https://imageshack.com/i/4jgo6xj
拆下的电磁铁背面可见一半月形薄弹片。它原来被机械锁拨片拨动,从而带动电磁铁中
心的锁栓上下移动。... 阅读全帖 |
|
f*****g 发帖数: 15860 | 15 唬不住的,short stack一般就两种,毛驴,和就是故意short buy-in要拼的那种。
你如果没有超常的read,pot control和fold能力,你就是靶子,给人提供很好的
implied odds。
你注意观察各个stake那些deep stack的(不排除毛驴运气好,“暂时”deep的,呵呵)
,往往都很油,开始可能比较凶,但是turn以后明显在省时度势,所以有时候你看到
river的话,可能还觉得他们的牌有点保守了。
你真正需要200BB+和另一个deep stack拼,怕赢少了的情况,其实并不多,而且即使出
现的话,往往也是一线之间的差距,不出一身汗拿不下来。 |
|
p**********1 发帖数: 1458 | 16 in $50k madness, got a decent stack, but lose a few all-in pots to short
stacks
during bubble time: AJ v.s. AQ, AKs v.s. 9-9, then hit a run of card drought
, and
eventually busted at around 300th.
The AJ vs AQ really made me wonder whether I had made some mistake. at mid
position
2, I open raise 3xbb with AJ, stack size about 30bb, blinds level 400/800
ante 100.
button shove with 12bb, both blinds folded, pot odd looks good, but I did
feel huge
underdog calling the all in, tough decision there. |
|
s*********k 发帖数: 1989 | 17 r u playing RUSH PLO?
I play it with mini buy-in and log-off/reload whenever doubled up.
At PLO, combination is too many. It is very touch to play deep-stack, TO ME.
I sometime push allin with two pairs if no SD/FD.
See quite a few players with deep stack. They fold a lot to pot-commit bet,
but stick with SD/FD a lot.
One tricky thing is, at/aft turn, many times it is math correct to allin/call pot
for stock stack. Call/Bet on flop is more important. But at multiway, it is
very tricky. Set with ... 阅读全帖 |
|
W********m 发帖数: 7793 | 18 Hand 2)
I have 10hJh on bb.
lp raise 3$, co calls 3$ I squeeze to 13$ preflop.
lp fold Co is short stack calls.
flop Ac7h6h Not a bad flop for me.. CO left with 34$ and pot is 29$.
I lead shove all in, CO snap with Ah2h. ouch. I made my flush in the end but i was drawing dead.
Can't win vs short stack fish sometimes...
[X]expert flat 3 bet with A2s
[X]get it in when the other party is drawing dead on the flop
Congratulations to a job well done by a short stack. |
|
W********m 发帖数: 7793 | 19 Hand 5)
ep short stack 30$ stack raise 3$,
i am at MP with AcAh. trying to be a smart ass i flat. 2 more caller button
and bb (65$) short stack too..
Flop is magic
As2s2c
The rest is a blur, but bb has 22 and reraised my 26$ bet river all in to 29
$ and 45c.. no surprise. |
|
W********m 发帖数: 7793 | 20 He is a short stack fish and he can have any thing from bottom set to A high
or gut shot. His range seems irrelevant to me here. You are way passed stack commitment
threshold. If you fold here, then you should not have isolated short stack
fish preflop with a weak holding like 87o. |
|
p**********1 发帖数: 1458 | 21 I think it depends on stack size as well. if not too deep then two streets
may be enough to get it in. if fairly deep and villain is fishy then betting
flop might be better. in general the pot size grow at exponential speed
with respect to betting rounds. I remember harrington did some generic
calculation about whether we should bet monsters on the flop in one of his
books. and his conclusion is betting is better in general, I think(don't
quite remember) the effective stack size is about 100bb i... 阅读全帖 |
|
p****0 发帖数: 611 | 22 Hero had stack of 200ish at UTG. Aggressive style. Steal pots often.
Villain 1 had stack of 500ish at UTG+1. He is a week guy. Saw him raise PF
with AK twice. Folded 99 PF one time facing my push of 130ish with 66
against BTN's shove of 100ish. That hand flopped 996. And the 4th 6 didn't
come out. If did, I would be pissed off by missing the bad beat.
Villain 2 is a middle age guy, normal player with mixed play some time. He
had stack of 300ish at BTN.
Hero straddle and waked up with 54... 阅读全帖 |
|
q****8 发帖数: 3281 | 23 总体思想:冒着引多人进锅,和被人suck out的风险,要EV最大化。
600NL 6max
SB $625, top reg
BB $308, bad semi reg
UTG $265, short stack reg
UTG+1 (Hero) $671, with KK
CO $857, short stack reg turns into big stack
BTN $680, bad semi reg
Preflop
UTG opens to $15
Hero calls
CO calls
BTN calls
SB folds
BB calls
Flop 669 rainbow
BB check
UTG cbet $50
Hero calls $50
CO folds
BTN folds
BB shove $293
UTG calls and All in
Hero calls
BB shows A9o
UTG shows QQ
Turn 7
River 2 |
|
j****c 发帖数: 19908 | 24 【 以下文字转载自 PhotoGear 讨论区 】
发信人: jjjstc (买买提就是一个垃圾处理站), 信区: PhotoGear
标 题: focus stacking 微距照 2
发信站: BBS 未名空间站 (Sun Apr 19 01:06:55 2015, 美东)
今天在路边采了一朵野花,继续focus stacking。第一张是选取的single frame对焦在
花蕊上得,第二张是将15张不同对焦点的照片进行focus stacking之后的合成照。这次
比上次的对比效果更明显了
单张
合成后
单张
合成后 |
|
l******0 发帖数: 313 | 25 你的意思是不是说一定需要OS?
我知道有些TCP/IP stack是可以不需要OS的~
例如:IwIP:http://www.sics.se/~adam/lwip/
但这个只是一个独立的stack,我想要那种集成了tcp/ip stack和web server的~ |
|
e**c 发帖数: 195 | 26 The specification of JVM does not fix the shape of stack frames. That means
an implementator of JVM can decide where to put local variables, the
operand stack and state variables. Is it possible to write a Jasmin
program that allow to find out where these components are allocated in the
stack frame? |
|
p***p 发帖数: 559 | 27 yes, normally the server is based on a protocol stack. SIP server on SIP
stack ...
Tomcat and Jetty parser the TCP/UDP payload himslef instead using a stack
with interface. |
|
u****u 发帖数: 229 | 28 我的意思是compiler把这个b[100]放到stack上,不是programmer决定的。一般的
compiler看到int b[100]就会在stack上安排一个100个int的空间,我问的是可以不可以
有一个“特别的compiler”,把这个"100个int"的空间放到heap上。这个过程对
programmer是透明的,programmer不能控制的。
或者从另一个角度说,如果你看到int b[100],programmer能不能认为这个存储空间一定
是在stack上的?会不会有一个特别的compiler为了某种需要将这个存储空间安排到heap
上?如果compiler这么做,会不会违反C中的某些规定? |
|
w*******e 发帖数: 285 | 29 我的理解是function内部的变量都进stack,普通function执行完了就被清除,静态函数
的变量一直在stack里面直到程序终结。heap是放静态变量和全局变量的地方,动态分
配的内存也放在stack当中,如果不release就会有泄漏,直到程序终结。
请问这是对的吗? |
|
b**a 发帖数: 1118 | 30 Design an efficient algorithm to sort elements in a stack in either
ascending/descending order, using only pop(), top(), push(), isEmpty(),
isFull(). Do not use any auxiliary stacks or arrays.
I found this question in jobhunting board. the anwser given by a niu ren is
Is this right? Does not look like right one.Thanks. |
|
w***g 发帖数: 5958 | 31 This is a recursive algorithm, and it actually uses an auxiliary stack
, though not obvious to newbies. This is actually more dangerous than
explicitly using some auxiliary data structure because recursion may lead to
stack overflow.
is |
|
b*****d 发帖数: 23 | 32 #include
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int a[] = {1,2,3,4,5,6,7};
stack stack1;
stack stack2;
for(int i = 0; i<7; ++i)
stack1.push(a[i]);
int i = stack1.size();
while(!stack1.empty())
{
for(int j = 0; j
{
stack2.push(stack1.top());
stack1.pop();
}
in |
|
r****o 发帖数: 1950 | 33 【 以下文字转载自 JobHunting 讨论区 】
发信人: roufoo (五经勤向窗前读), 信区: JobHunting
标 题: 用C设计Stack的interface,要求支持各种数据类型。
发信站: BBS 未名空间站 (Thu Oct 14 01:37:02 2010, 美东)
【 以下文字转载自 InterviewHackers 俱乐部 】
发信人: roufoo (五经勤向窗前读), 信区: InterviewHackers
标 题: 用C设计Stack的interface,要求支持各种数据类型。
发信站: BBS 未名空间站 (Thu Oct 14 01:36:53 2010, 美东)
用C设计Stack的interface(push, pop, top, ...),要求支持各种数据类型。
C不支持template,那怎么设计比较好呢? |
|
l******d 发帖数: 530 | 34 【 以下文字转载自 JobHunting 讨论区 】
发信人: lwsOsgvd (lwsOsgvd), 信区: JobHunting
标 题: 用c怎么实现generic stack
发信站: BBS 未名空间站 (Tue Apr 24 16:42:43 2012, 美东)
用设计个stack,要求是The stack should be able to take as input a wide
variety of data types: it could range from byte sized to an n-byte sized
structure。
刚好在PIE书里面看到这个
typedef struct Element {
struct Element *next;
void *data;
} Element;
不知道算不算达到要求。
多谢! |
|
z***t 发帖数: 14 | 35 所有的recursion algorithm都可以写成iterative algorithm + stack.这个时候的
stack是在heap上的。而一个程序stack的大小远小于heap的大小,既然这样,compiler
为什么不遇到recursion call就在heap上做? |
|
p***o 发帖数: 1252 | 36 You can change the stack size as you like so you cannot simply say
stack size is much smaller than heap size.
Stack size is small by default though, which allows OS to quickly
catch bugs related to termination of your recursive functions.
If your compiler moves most of the things to the heap, you may need
to wait for quite a while before your program fails. |
|
v****m 发帖数: 26 | 37 【 以下文字转载自 Unix 讨论区,原文如下 】
发信人: vvllmm (vv), 信区: Unix
标 题: re:How to check the stack-size?
发信站: The unknown SPACE (Wed Jul 10 13:45:43 2002) WWW-POST
'Limit' gives the limitation on the machine, not the running code's stack
size. The reason I wanna know that is because once I use another larger set of
input data, I got a bus error(not sure about it), while use smaller set of
input data, no problem at all, the code runs smoothly.
Thank you.
stack-size? |
|
z*******n 发帖数: 1034 | 38 http://www.infoq.com/research/mobile-apps-stack
by Ralph Winzinger on Mar 18, 2014
Native toolkits
Apple Xcode (iOS): Apples full featured development environment lets you
create mobile apps as well as desktop applications. Xcode comes with
integrated support for Git source-code repositories, graphical editor to
build user interfaces, instrumentation and debugging tooling and integrated
documentation. You need Mac OS X to run XCode and it is free of charge.
IntelliJ AppCode (iOS): Jetbrains, cre... 阅读全帖 |
|
|
w*******y 发帖数: 60932 | 40 Amazon
Fisher-Price Brilliant Basics Stack & Nest Pots & Pans
$4.59
Free shipping with Amazon Prime or if you spend $25 or more
google.com:
http://www.google.com/products/catalog?q=Fisher-Price Brilliant Basics Stack & Nest Pots & Pans&hl=en&cid=1823159201850813567&ei=L552TIHBM4L-NeH5tcUB&sa=button&ved=0CAkQgggwADgA#p
#p" rel="nofollow" target="_blank" onclick="try{pageTracker._trackEvent('
thread', 'click', '2200750 - fisherprice-brilliant-basics-stack-&-nest-pots-
&-pans-$4.59-at-amazon');} c |
|
w*******y 发帖数: 60932 | 41 For all of the Mini Boden lovers out there ...
Shop now and most kids- boys and girls (not baby) tops, hoodies, and
sweaters are 30% off, and for the first time ever Boden is allowing you to
stack them with other promotion codes.
Use H441 for an additional 20% off and Free Shipping and Free Returns OR
Use H504 for Buy 2 items and get 1 item (the 3rd item of lowest value) for $
1 with Free Shipping
You WILL NOT be able to use both codes, just one or the other. The 30% off
prices are automatic. If... 阅读全帖 |
|
w*******y 发帖数: 60932 | 42 The Bean Coffee Company Guatemala, Organic Ground, 16-Oz Bags (Pack of 2), $
9.70, Vienna Roast, Organic Ground $8.51. Plus other Bean Coffee with
Stacking Coupons free ship Amazon
Note: Stacking Coupon and Promo Code only works on 12-ounce and 16-ounce
Bags
Stack $3.25 off Coupon, 20% Promo Code and 15% Subscribe and Save to get
Price and free Shipping
Use Promo Code THEBEAN8 to save 20%
Start Here and look for $3.25 Coupon (may have to Refresh several times)
Link:
http://www.amazon.com/gp/fea... 阅读全帖 |
|
|
w****g 发帖数: 597 | 44 http://www.chinadaily.com.cn/china/2010-02/12/content_9465789.htm
Shelves stacked with GM foods
By Shan Juan (China Daily)
Updated: 2010-02-12 07:47
Call for mandatory labeling of products to protect consumers
Although the typical Chinese kitchen is now likely to have many food
ingredients that have been genetically modified (GM), awareness of the issue
remains poor among the public, the latest online survey has found.
Shelves stacked with GM foods
A chef displays a dish made from genetically mo |
|
发帖数: 1 | 45 GEIRI North America is looking for a Front-End /Full Stack Intern/contractor
Developer to help out with our growing development team.
Location: San Jose, CA
Required Skills:
• 1+ years of experience developing scalable full-stack solutions
• Experience with Java/C
• Experience with database technologies such as SQL or NoSQL
• Experience with JavaScript, HTML, and CSS
• Experience with implementing REST APIs
• Experience with source control pl... 阅读全帖 |
|
发帖数: 1 | 46 UPS项目急招多名senior full stack developer, senior front end developer,高薪,
详细面谈。
工作地点在secaucus, nj的ups office。
职位要求
senior front end developer:
1. 精通各种前端技术(包括 HTML/CSS/JavaScript等),熟悉常见问题和对策;
2. 熟悉前端框架 Angular/WebPack/babel/Bootstrap 等,能独立开发常用组件,熟悉前
端 MVC, MVVM 架构;
3. 熟练使用各种调试抓包工具,能独立分析,解决和归纳问题;
4. 对技术有持续的热情,学习能力出众,逻辑性强,个性乐观开朗,善于合作;
5. 会说中文,英语可以无障碍沟通;
6. 愿意或者具备带领junior/intern的经验者加分。
senior full stack developer:
1. 丰富的后端开发经验,了解 Node.js, 精通以下语言的一种或多种:.net, Node.js,
Python,Ruby,PHP,Java;
2. 熟练掌握 web 应用服务... 阅读全帖 |
|
s****g 发帖数: 56 | 47 4 bytes at least. There is a '\0'.
I think heap memory is allocated with malloc.
Otherwise on stack or somewhere else.
Probably x is on stack (it is a pointer) and "abc" is on
global constant area. Not 100% sure.
space and |
|
s*******e 发帖数: 174 | 48 【 以下文字转载自 Java 讨论区 】
发信人: shrubRose (喵喵喵), 信区: Java
标 题: 一道 JAVA Stack vs Heap 题
发信站: BBS 未名空间站 (Mon Nov 9 13:59:15 2009, 美东)
String s1 = "grapefruit";
String s2 = "grapefruit";
请问 s1 and s2 是在 stack 还是 heap 上呢? Does s1 and s2 point to same
address?
String s3 = "grape"+"fruit";
Does s3 point to same address as s1 and s2?
String s4 = new String("grapefruit");
String s5 = new String("grapefruit");
s4 and s5 should be in heap, s4 and s5 should point to different addresses,
right?
System.out.print |
|
c*****y 发帖数: 90 | 49 用两个stack实现queue很容易。用一个我怎么觉得不可能呀。有人用递归方法,可是我
觉得递归实际
上是用了另一个stack。 |
|
B*****t 发帖数: 335 | 50 There are 3 memory storage types for c++ to allocate memory for an object.
1. stack memory for object inside a function.
2. static storage for namespace-scope objects and local static objects
3. heap storage for dynamically-allocated objects.
If the stack in you problem refers to the first type of memory storage,
there is only one method that you could do this, which is defining a
function, allocating memory for an object inside a function, and using it.
You cannot use it outside of a function. |
|