|
|
back to boardTip Inside (+) I used next algo. Let Value[i] be some value. Let Prev[i] be previouse to i element. It is 3 byte value!!! This was made using next feature: I store Ind1[i], Ind2[i], Ind3[i] of byte then when i need real index i use Ind1[i]*256*256 + Ind2[i]*256 + Ind3[i]. Top[i] - index of top of stack. for i <- 1 to N do fetch[read] op. if it is PUSH(st, x) then Value[i] = x Prev[i] = Top[st] Top[st] = i if it is POP(st) then WriteLn(Value[Top[St]]); Top[St] = Prev[Top[St]] Re: Tip Inside (+) Posted by TheBeet 17 May 2004 13:43 >I used next algo. >Let Value[i] be some value. >Let Prev[i] be previouse to i element. It is 3 byte >value!!! This was >made using next feature: I store Ind1[i], Ind2[i], Ind3[i] >of byte >then when i need real index i use Ind1[i]*256*256 + Ind2[i]>*256 + >Ind3[i]. >Top[i] - index of top of stack. Can it be AC? It use (4+3)*N btye. If N=100000 It must be memory limit. Edited by author 17.05.2004 13:44 |
|
|