由买买提看人间百态

topics

全部话题 - 话题: head0
(共0页)
b******7
发帖数: 92
1
来自主题: JobHunting版 - implement 3 stack in an array
注意左移右移就行了
第一个栈[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;
}
... 阅读全帖
Y**s
发帖数: 1632
2
来自主题: Tennis版 - 2, 3个oz的差别究竟有多大
the balance of the racket will result in significant differences in swing
weight. Even though your new racket is heavier, it's got a more head-light
design so that when you swing it it doesn't feel like a big head0-heavy '
hammer'. The smaller head also cuts through the air a little better so that
probably also helps you with the perception.
How do you like it so far? Keep in mind that the strings on this thing is
freaking ancient... lol I played with it like 2 times before putting it
away,
(共0页)