面试题吐槽系列之一
问题
“递归反转栈——只使用常数量个变量”,这个问题就这一句话
解答
我们要反转一个栈,如果使用另外一个栈作为辅助的话,那么反转起来很简单,一个接一个push到辅助栈里再push回来就行了。那么假如不能使用辅助栈,数组等空间为O(n)的数据结构,只使用O(1)的空间复杂度即只能有常数个变量,怎么实现将栈反转?即原来的栈顶在栈底,栈底变成栈顶。
画图表示大概是这样的:
- 首先假设栈里面从栈底到栈顶存储的依次是 1 2 3 4 5,我们反转以后希望得到的结果是 5 4 3 2 1.
- 第一步pop出来第一个数5,存到temp1中,此时的栈中由下到上是1 2 3 4。
- 递归调用自身,不用考虑具体的过程,我们只需要知道这个递归调用结束后得到的结果是使栈中的元素变成了由下到上 4 3 2 1(因为这个函数本身的意思就是反转栈)。
- 此时pop出来第二个数1 ,存到temp2中,此时的栈中由下到上是 4 3 2。
- 再递归调用本身,抽象考虑这个递归完成后得到的结果是栈中的值变成了 2 3 4。
- 接着我们把push(temp1),栈变成了 2 3 4 5。
- 接着递归调用本身,递归完成后栈变成了 5 4 3 2。
- 接着push(temp2)。好了,栈变成了 5 4 3 2 1,反转完成!
=====================华丽的分割线=============================
吐槽
以上的解答过程摘抄自某博客,这个问题是面试经常遇到的问题。首先来看解答过程是正常的,面试官也是希望看你这样回答。下面我们来详细的分析一下这个问题,问题其实就是栈的反转,或者叫栈的逆制,不过要求是O(1),也就是常量级别的空间复杂度,这个O(1)如何理解呢,如果栈的长度是N那么这个用的空间要远小N,否则就不能说是O(1),那TM叫,N/2或N/3,亦或N/M(M << N)。假设,如果栈大小为100,那么这个多余的空间用1,2甚至10个都是没有问题。
下面是我用python实现了一遍上面的逻辑,代码如下:
1 import copy 2 3 4 class my_stack(object): 5 def __init__(self, num_list): 6 self.stack = copy.deepcopy(num_list) 7 8 def stack_print(self): 9 print self.stack 10 11 def stack_pop(self): 12 if len(self.stack) > 0: 13 return self.stack.pop(len(self.stack) - 1) 14 else: 15 return None 16 17 def stack_push(self, data): 18 self.stack.append(data) 19 20 def stack_empty(self): 21 if len(self.stack) <= 0: 22 return True 23 else: 24 return False 25 26 27 def reverse_stack(stack, i, j): 28 if stack.stack_empty() is True: 29 i -= 1 30 j -= 1 31 return 32 33 tmp = stack.stack_pop() 34 reverse_stack(stack, i, j) 35 i += 1 36 print 'first variable new count:' + str(i) + '\t address:' + hex(id(tmp)) 37 if stack.stack_empty() is True: 38 stack.stack_push(tmp) 39 return 40 41 tmp2 = stack.stack_pop() 42 j += 1 43 print 'second variable new count:' + str(j) + '\t address:' + hex(id(tmp2)) 44 45 reverse_stack(stack, i, j) 46 stack.stack_push(tmp) 47 reverse_stack(stack, i, j) 48 stack.stack_push(tmp2) 49 50 if __name__ == "__main__": 51 tmp_stack = my_stack([1, 2, 3, 5, 6, 7, 8, 9]) 52 53 reverse_stack(tmp_stack, 0, 0) 54 tmp_stack.stack_print()
执行完的结果为(结果较大谨慎展开):
1 first variable new count:1 address:0x1d979a8L 2 first variable new count:1 address:0x1d97990L 3 second variable new count:1 address:0x1d979a8L 4 first variable new count:2 address:0x1d97990L 5 first variable new count:1 address:0x1d97978L 6 second variable new count:1 address:0x1d979a8L 7 first variable new count:2 address:0x1d97990L 8 first variable new count:2 address:0x1d97990L 9 first variable new count:2 address:0x1d97978L 10 second variable new count:2 address:0x1d97990L 11 first variable new count:3 address:0x1d97978L 12 first variable new count:1 address:0x1d97948L 13 second variable new count:1 address:0x1d979a8L 14 first variable new count:2 address:0x1d97978L 15 first variable new count:2 address:0x1d97990L 16 second variable new count:2 address:0x1d97978L 17 first variable new count:3 address:0x1d97990L 18 first variable new count:2 address:0x1d97990L 19 first variable new count:2 address:0x1d97978L 20 second variable new count:2 address:0x1d97990L 21 first variable new count:3 address:0x1d97978L 22 first variable new count:2 address:0x1d97948L 23 second variable new count:2 address:0x1d97990L 24 first variable new count:3 address:0x1d97978L 25 first variable new count:3 address:0x1d97978L 26 first variable new count:3 address:0x1d97948L 27 second variable new count:3 address:0x1d97978L 28 first variable new count:4 address:0x1d97948L 29 first variable new count:1 address:0x1d97930L 30 second variable new count:1 address:0x1d979a8L 31 first variable new count:2 address:0x1d97948L 32 first variable new count:2 address:0x1d97978L 33 second variable new count:2 address:0x1d97948L 34 first variable new count:3 address:0x1d97978L 35 first variable new count:2 address:0x1d97990L 36 second variable new count:2 address:0x1d97948L 37 first variable new count:3 address:0x1d97978L 38 first variable new count:3 address:0x1d97978L 39 first variable new count:3 address:0x1d97990L 40 second variable new count:3 address:0x1d97978L 41 first variable new count:4 address:0x1d97990L 42 first variable new count:2 address:0x1d97990L 43 first variable new count:2 address:0x1d97978L 44 second variable new count:2 address:0x1d97990L 45 first variable new count:3 address:0x1d97978L 46 first variable new count:2 address:0x1d97948L 47 second variable new count:2 address:0x1d97990L 48 first variable new count:3 address:0x1d97978L 49 first variable new count:3 address:0x1d97978L 50 first variable new count:3 address:0x1d97948L 51 second variable new count:3 address:0x1d97978L 52 first variable new count:4 address:0x1d97948L 53 first variable new count:2 address:0x1d97930L 54 second variable new count:2 address:0x1d97990L 55 first variable new count:3 address:0x1d97948L 56 first variable new count:3 address:0x1d97978L 57 second variable new count:3 address:0x1d97948L 58 first variable new count:4 address:0x1d97978L 59 first variable new count:3 address:0x1d97978L 60 first variable new count:3 address:0x1d97948L 61 second variable new count:3 address:0x1d97978L 62 first variable new count:4 address:0x1d97948L 63 first variable new count:3 address:0x1d97930L 64 second variable new count:3 address:0x1d97978L 65 first variable new count:4 address:0x1d97948L 66 first variable new count:4 address:0x1d97948L 67 first variable new count:4 address:0x1d97930L 68 second variable new count:4 address:0x1d97948L 69 first variable new count:5 address:0x1d97930L 70 first variable new count:1 address:0x1d97918L 71 second variable new count:1 address:0x1d979a8L 72 first variable new count:2 address:0x1d97930L 73 first variable new count:2 address:0x1d97948L 74 second variable new count:2 address:0x1d97930L 75 first variable new count:3 address:0x1d97948L 76 first variable new count:2 address:0x1d97978L 77 second variable new count:2 address:0x1d97930L 78 first variable new count:3 address:0x1d97948L 79 first variable new count:3 address:0x1d97948L 80 first variable new count:3 address:0x1d97978L 81 second variable new count:3 address:0x1d97948L 82 first variable new count:4 address:0x1d97978L 83 first variable new count:2 address:0x1d97990L 84 second variable new count:2 address:0x1d97930L 85 first variable new count:3 address:0x1d97978L 86 first variable new count:3 address:0x1d97948L 87 second variable new count:3 address:0x1d97978L 88 first variable new count:4 address:0x1d97948L 89 first variable new count:3 address:0x1d97948L 90 first variable new count:3 address:0x1d97978L 91 second variable new count:3 address:0x1d97948L 92 first variable new count:4 address:0x1d97978L 93 first variable new count:3 address:0x1d97990L 94 second variable new count:3 address:0x1d97948L 95 first variable new count:4 address:0x1d97978L 96 first variable new count:4 address:0x1d97978L 97 first variable new count:4 address:0x1d97990L 98 second variable new count:4 address:0x1d97978L 99 first variable new count:5 address:0x1d97990L 100 first variable new count:2 address:0x1d97990L 101 first variable new count:2 address:0x1d97978L 102 second variable new count:2 address:0x1d97990L 103 first variable new count:3 address:0x1d97978L 104 first variable new count:2 address:0x1d97948L 105 second variable new count:2 address:0x1d97990L 106 first variable new count:3 address:0x1d97978L 107 first variable new count:3 address:0x1d97978L 108 first variable new count:3 address:0x1d97948L 109 second variable new count:3 address:0x1d97978L 110 first variable new count:4 address:0x1d97948L 111 first variable new count:2 address:0x1d97930L 112 second variable new count:2 address:0x1d97990L 113 first variable new count:3 address:0x1d97948L 114 first variable new count:3 address:0x1d97978L 115 second variable new count:3 address:0x1d97948L 116 first variable new count:4 address:0x1d97978L 117 first variable new count:3 address:0x1d97978L 118 first variable new count:3 address:0x1d97948L 119 second variable new count:3 address:0x1d97978L 120 first variable new count:4 address:0x1d97948L 121 first variable new count:3 address:0x1d97930L 122 second variable new count:3 address:0x1d97978L 123 first variable new count:4 address:0x1d97948L 124 first variable new count:4 address:0x1d97948L 125 first variable new count:4 address:0x1d97930L 126 second variable new count:4 address:0x1d97948L 127 first variable new count:5 address:0x1d97930L 128 first variable new count:2 address:0x1d97918L 129 second variable new count:2 address:0x1d97990L 130 first variable new count:3 address:0x1d97930L 131 first variable new count:3 address:0x1d97948L 132 second variable new count:3 address:0x1d97930L 133 first variable new count:4 address:0x1d97948L 134 first variable new count:3 address:0x1d97978L 135 second variable new count:3 address:0x1d97930L 136 first variable new count:4 address:0x1d97948L 137 first variable new count:4 address:0x1d97948L 138 first variable new count:4 address:0x1d97978L 139 second variable new count:4 address:0x1d97948L 140 first variable new count:5 address:0x1d97978L 141 first variable new count:3 address:0x1d97978L 142 first variable new count:3 address:0x1d97948L 143 second variable new count:3 address:0x1d97978L 144 first variable new count:4 address:0x1d97948L 145 first variable new count:3 address:0x1d97930L 146 second variable new count:3 address:0x1d97978L 147 first variable new count:4 address:0x1d97948L 148 first variable new count:4 address:0x1d97948L 149 first variable new count:4 address:0x1d97930L 150 second variable new count:4 address:0x1d97948L 151 first variable new count:5 address:0x1d97930L 152 first variable new count:3 address:0x1d97918L 153 second variable new count:3 address:0x1d97978L 154 first variable new count:4 address:0x1d97930L 155 first variable new count:4 address:0x1d97948L 156 second variable new count:4 address:0x1d97930L 157 first variable new count:5 address:0x1d97948L 158 first variable new count:4 address:0x1d97948L 159 first variable new count:4 address:0x1d97930L 160 second variable new count:4 address:0x1d97948L 161 first variable new count:5 address:0x1d97930L 162 first variable new count:4 address:0x1d97918L 163 second variable new count:4 address:0x1d97948L 164 first variable new count:5 address:0x1d97930L 165 first variable new count:5 address:0x1d97930L 166 first variable new count:5 address:0x1d97918L 167 second variable new count:5 address:0x1d97930L 168 first variable new count:6 address:0x1d97918L 169 first variable new count:1 address:0x1d97900L 170 second variable new count:1 address:0x1d979a8L 171 first variable new count:2 address:0x1d97918L 172 first variable new count:2 address:0x1d97930L 173 second variable new count:2 address:0x1d97918L 174 first variable new count:3 address:0x1d97930L 175 first variable new count:2 address:0x1d97948L 176 second variable new count:2 address:0x1d97918L 177 first variable new count:3 address:0x1d97930L 178 first variable new count:3 address:0x1d97930L 179 first variable new count:3 address:0x1d97948L 180 second variable new count:3 address:0x1d97930L 181 first variable new count:4 address:0x1d97948L 182 first variable new count:2 address:0x1d97978L 183 second variable new count:2 address:0x1d97918L 184 first variable new count:3 address:0x1d97948L 185 first variable new count:3 address:0x1d97930L 186 second variable new count:3 address:0x1d97948L 187 first variable new count:4 address:0x1d97930L 188 first variable new count:3 address:0x1d97930L 189 first variable new count:3 address:0x1d97948L 190 second variable new count:3 address:0x1d97930L 191 first variable new count:4 address:0x1d97948L 192 first variable new count:3 address:0x1d97978L 193 second variable new count:3 address:0x1d97930L 194 first variable new count:4 address:0x1d97948L 195 first variable new count:4 address:0x1d97948L 196 first variable new count:4 address:0x1d97978L 197 second variable new count:4 address:0x1d97948L 198 first variable new count:5 address:0x1d97978L 199 first variable new count:2 address:0x1d97990L 200 second variable new count:2 address:0x1d97918L 201 first variable new count:3 address:0x1d97978L 202 first variable new count:3 address:0x1d97948L 203 second variable new count:3 address:0x1d97978L 204 first variable new count:4 address:0x1d97948L 205 first variable new count:3 address:0x1d97930L 206 second variable new count:3 address:0x1d97978L 207 first variable new count:4 address:0x1d97948L 208 first variable new count:4 address:0x1d97948L 209 first variable new count:4 address:0x1d97930L 210 second variable new count:4 address:0x1d97948L 211 first variable new count:5 address:0x1d97930L 212 first variable new count:3 address:0x1d97930L 213 first variable new count:3 address:0x1d97948L 214 second variable new count:3 address:0x1d97930L 215 first variable new count:4 address:0x1d97948L 216 first variable new count:3 address:0x1d97978L 217 second variable new count:3 address:0x1d97930L 218 first variable new count:4 address:0x1d97948L 219 first variable new count:4 address:0x1d97948L 220 first variable new count:4 address:0x1d97978L 221 second variable new count:4 address:0x1d97948L 222 first variable new count:5 address:0x1d97978L 223 first variable new count:3 address:0x1d97990L 224 second variable new count:3 address:0x1d97930L 225 first variable new count:4 address:0x1d97978L 226 first variable new count:4 address:0x1d97948L 227 second variable new count:4 address:0x1d97978L 228 first variable new count:5 address:0x1d97948L 229 first variable new count:4 address:0x1d97948L 230 first variable new count:4 address:0x1d97978L 231 second variable new count:4 address:0x1d97948L 232 first variable new count:5 address:0x1d97978L 233 first variable new count:4 address:0x1d97990L 234 second variable new count:4 address:0x1d97948L 235 first variable new count:5 address:0x1d97978L 236 first variable new count:5 address:0x1d97978L 237 first variable new count:5 address:0x1d97990L 238 second variable new count:5 address:0x1d97978L 239 first variable new count:6 address:0x1d97990L 240 first variable new count:2 address:0x1d97990L 241 first variable new count:2 address:0x1d97978L 242 second variable new count:2 address:0x1d97990L 243 first variable new count:3 address:0x1d97978L 244 first variable new count:2 address:0x1d97948L 245 second variable new count:2 address:0x1d97990L 246 first variable new count:3 address:0x1d97978L 247 first variable new count:3 address:0x1d97978L 248 first variable new count:3 address:0x1d97948L 249 second variable new count:3 address:0x1d97978L 250 first variable new count:4 address:0x1d97948L 251 first variable new count:2 address:0x1d97930L 252 second variable new count:2 address:0x1d97990L 253 first variable new count:3 address:0x1d97948L 254 first variable new count:3 address:0x1d97978L 255 second variable new count:3 address:0x1d97948L 256 first variable new count:4 address:0x1d97978L 257 first variable new count:3 address:0x1d97978L 258 first variable new count:3 address:0x1d97948L 259 second variable new count:3 address:0x1d97978L 260 first variable new count:4 address:0x1d97948L 261 first variable new count:3 address:0x1d97930L 262 second variable new count:3 address:0x1d97978L 263 first variable new count:4 address:0x1d97948L 264 first variable new count:4 address:0x1d97948L 265 first variable new count:4 address:0x1d97930L 266 second variable new count:4 address:0x1d97948L 267 first variable new count:5 address:0x1d97930L 268 first variable new count:2 address:0x1d97918L 269 second variable new count:2 address:0x1d97990L 270 first variable new count:3 address:0x1d97930L 271 first variable new count:3 address:0x1d97948L 272 second variable new count:3 address:0x1d97930L 273 first variable new count:4 address:0x1d97948L 274 first variable new count:3 address:0x1d97978L 275 second variable new count:3 address:0x1d97930L 276 first variable new count:4 address:0x1d97948L 277 first variable new count:4 address:0x1d97948L 278 first variable new count:4 address:0x1d97978L 279 second variable new count:4 address:0x1d97948L 280 first variable new count:5 address:0x1d97978L 281 first variable new count:3 address:0x1d97978L 282 first variable new count:3 address:0x1d97948L 283 second variable new count:3 address:0x1d97978L 284 first variable new count:4 address:0x1d97948L 285 first variable new count:3 address:0x1d97930L 286 second variable new count:3 address:0x1d97978L 287 first variable new count:4 address:0x1d97948L 288 first variable new count:4 address:0x1d97948L 289 first variable new count:4 address:0x1d97930L 290 second variable new count:4 address:0x1d97948L 291 first variable new count:5 address:0x1d97930L 292 first variable new count:3 address:0x1d97918L 293 second variable new count:3 address:0x1d97978L 294 first variable new count:4 address:0x1d97930L 295 first variable new count:4 address:0x1d97948L 296 second variable new count:4 address:0x1d97930L 297 first variable new count:5 address:0x1d97948L 298 first variable new count:4 address:0x1d97948L 299 first variable new count:4 address:0x1d97930L 300 second variable new count:4 address:0x1d97948L 301 first variable new count:5 address:0x1d97930L 302 first variable new count:4 address:0x1d97918L 303 second variable new count:4 address:0x1d97948L 304 first variable new count:5 address:0x1d97930L 305 first variable new count:5 address:0x1d97930L 306 first variable new count:5 address:0x1d97918L 307 second variable new count:5 address:0x1d97930L 308 first variable new count:6 address:0x1d97918L 309 first variable new count:2 address:0x1d97900L 310 second variable new count:2 address:0x1d97990L 311 first variable new count:3 address:0x1d97918L 312 first variable new count:3 address:0x1d97930L 313 second variable new count:3 address:0x1d97918L 314 first variable new count:4 address:0x1d97930L 315 first variable new count:3 address:0x1d97948L 316 second variable new count:3 address:0x1d97918L 317 first variable new count:4 address:0x1d97930L 318 first variable new count:4 address:0x1d97930L 319 first variable new count:4 address:0x1d97948L 320 second variable new count:4 address:0x1d97930L 321 first variable new count:5 address:0x1d97948L 322 first variable new count:3 address:0x1d97978L 323 second variable new count:3 address:0x1d97918L 324 first variable new count:4 address:0x1d97948L 325 first variable new count:4 address:0x1d97930L 326 second variable new count:4 address:0x1d97948L 327 first variable new count:5 address:0x1d97930L 328 first variable new count:4 address:0x1d97930L 329 first variable new count:4 address:0x1d97948L 330 second variable new count:4 address:0x1d97930L 331 first variable new count:5 address:0x1d97948L 332 first variable new count:4 address:0x1d97978L 333 second variable new count:4 address:0x1d97930L 334 first variable new count:5 address:0x1d97948L 335 first variable new count:5 address:0x1d97948L 336 first variable new count:5 address:0x1d97978L 337 second variable new count:5 address:0x1d97948L 338 first variable new count:6 address:0x1d97978L 339 first variable new count:3 address:0x1d97978L 340 first variable new count:3 address:0x1d97948L 341 second variable new count:3 address:0x1d97978L 342 first variable new count:4 address:0x1d97948L 343 first variable new count:3 address:0x1d97930L 344 second variable new count:3 address:0x1d97978L 345 first variable new count:4 address:0x1d97948L 346 first variable new count:4 address:0x1d97948L 347 first variable new count:4 address:0x1d97930L 348 second variable new count:4 address:0x1d97948L 349 first variable new count:5 address:0x1d97930L 350 first variable new count:3 address:0x1d97918L 351 second variable new count:3 address:0x1d97978L 352 first variable new count:4 address:0x1d97930L 353 first variable new count:4 address:0x1d97948L 354 second variable new count:4 address:0x1d97930L 355 first variable new count:5 address:0x1d97948L 356 first variable new count:4 address:0x1d97948L 357 first variable new count:4 address:0x1d97930L 358 second variable new count:4 address:0x1d97948L 359 first variable new count:5 address:0x1d97930L 360 first variable new count:4 address:0x1d97918L 361 second variable new count:4 address:0x1d97948L 362 first variable new count:5 address:0x1d97930L 363 first variable new count:5 address:0x1d97930L 364 first variable new count:5 address:0x1d97918L 365 second variable new count:5 address:0x1d97930L 366 first variable new count:6 address:0x1d97918L 367 first variable new count:3 address:0x1d97900L 368 second variable new count:3 address:0x1d97978L 369 first variable new count:4 address:0x1d97918L 370 first variable new count:4 address:0x1d97930L 371 second variable new count:4 address:0x1d97918L 372 first variable new count:5 address:0x1d97930L 373 first variable new count:4 address:0x1d97948L 374 second variable new count:4 address:0x1d97918L 375 first variable new count:5 address:0x1d97930L 376 first variable new count:5 address:0x1d97930L 377 first variable new count:5 address:0x1d97948L 378 second variable new count:5 address:0x1d97930L 379 first variable new count:6 address:0x1d97948L 380 first variable new count:4 address:0x1d97948L 381 first variable new count:4 address:0x1d97930L 382 second variable new count:4 address:0x1d97948L 383 first variable new count:5 address:0x1d97930L 384 first variable new count:4 address:0x1d97918L 385 second variable new count:4 address:0x1d97948L 386 first variable new count:5 address:0x1d97930L 387 first variable new count:5 address:0x1d97930L 388 first variable new count:5 address:0x1d97918L 389 second variable new count:5 address:0x1d97930L 390 first variable new count:6 address:0x1d97918L 391 first variable new count:4 address:0x1d97900L 392 second variable new count:4 address:0x1d97948L 393 first variable new count:5 address:0x1d97918L 394 first variable new count:5 address:0x1d97930L 395 second variable new count:5 address:0x1d97918L 396 first variable new count:6 address:0x1d97930L 397 first variable new count:5 address:0x1d97930L 398 first variable new count:5 address:0x1d97918L 399 second variable new count:5 address:0x1d97930L 400 first variable new count:6 address:0x1d97918L 401 first variable new count:5 address:0x1d97900L 402 second variable new count:5 address:0x1d97930L 403 first variable new count:6 address:0x1d97918L 404 first variable new count:6 address:0x1d97918L 405 first variable new count:6 address:0x1d97900L 406 second variable new count:6 address:0x1d97918L 407 first variable new count:7 address:0x1d97900L 408 first variable new count:1 address:0x1d978e8L 409 second variable new count:1 address:0x1d979a8L 410 first variable new count:2 address:0x1d97900L 411 first variable new count:2 address:0x1d97918L 412 second variable new count:2 address:0x1d97900L 413 first variable new count:3 address:0x1d97918L 414 first variable new count:2 address:0x1d97930L 415 second variable new count:2 address:0x1d97900L 416 first variable new count:3 address:0x1d97918L 417 first variable new count:3 address:0x1d97918L 418 first variable new count:3 address:0x1d97930L 419 second variable new count:3 address:0x1d97918L 420 first variable new count:4 address:0x1d97930L 421 first variable new count:2 address:0x1d97948L 422 second variable new count:2 address:0x1d97900L 423 first variable new count:3 address:0x1d97930L 424 first variable new count:3 address:0x1d97918L 425 second variable new count:3 address:0x1d97930L 426 first variable new count:4 address:0x1d97918L 427 first variable new count:3 address:0x1d97918L 428 first variable new count:3 address:0x1d97930L 429 second variable new count:3 address:0x1d97918L 430 first variable new count:4 address:0x1d97930L 431 first variable new count:3 address:0x1d97948L 432 second variable new count:3 address:0x1d97918L 433 first variable new count:4 address:0x1d97930L 434 first variable new count:4 address:0x1d97930L 435 first variable new count:4 address:0x1d97948L 436 second variable new count:4 address:0x1d97930L 437 first variable new count:5 address:0x1d97948L 438 first variable new count:2 address:0x1d97978L 439 second variable new count:2 address:0x1d97900L 440 first variable new count:3 address:0x1d97948L 441 first variable new count:3 address:0x1d97930L 442 second variable new count:3 address:0x1d97948L 443 first variable new count:4 address:0x1d97930L 444 first variable new count:3 address:0x1d97918L 445 second variable new count:3 address:0x1d97948L 446 first variable new count:4 address:0x1d97930L 447 first variable new count:4 address:0x1d97930L 448 first variable new count:4 address:0x1d97918L 449 second variable new count:4 address:0x1d97930L 450 first variable new count:5 address:0x1d97918L 451 first variable new count:3 address:0x1d97918L 452 first variable new count:3 address:0x1d97930L 453 second variable new count:3 address:0x1d97918L 454 first variable new count:4 address:0x1d97930L 455 first variable new count:3 address:0x1d97948L 456 second variable new count:3 address:0x1d97918L 457 first variable new count:4 address:0x1d97930L 458 first variable new count:4 address:0x1d97930L 459 first variable new count:4 address:0x1d97948L 460 second variable new count:4 address:0x1d97930L 461 first variable new count:5 address:0x1d97948L 462 first variable new count:3 address:0x1d97978L 463 second variable new count:3 address:0x1d97918L 464 first variable new count:4 address:0x1d97948L 465 first variable new count:4 address:0x1d97930L 466 second variable new count:4 address:0x1d97948L 467 first variable new count:5 address:0x1d97930L 468 first variable new count:4 address:0x1d97930L 469 first variable new count:4 address:0x1d97948L 470 second variable new count:4 address:0x1d97930L 471 first variable new count:5 address:0x1d97948L 472 first variable new count:4 address:0x1d97978L 473 second variable new count:4 address:0x1d97930L 474 first variable new count:5 address:0x1d97948L 475 first variable new count:5 address:0x1d97948L 476 first variable new count:5 address:0x1d97978L 477 second variable new count:5 address:0x1d97948L 478 first variable new count:6 address:0x1d97978L 479 first variable new count:2 address:0x1d97990L 480 second variable new count:2 address:0x1d97900L 481 first variable new count:3 address:0x1d97978L 482 first variable new count:3 address:0x1d97948L 483 second variable new count:3 address:0x1d97978L 484 first variable new count:4 address:0x1d97948L 485 first variable new count:3 address:0x1d97930L 486 second variable new count:3 address:0x1d97978L 487 first variable new count:4 address:0x1d97948L 488 first variable new count:4 address:0x1d97948L 489 first variable new count:4 address:0x1d97930L 490 second variable new count:4 address:0x1d97948L 491 first variable new count:5 address:0x1d97930L 492 first variable new count:3 address:0x1d97918L 493 second variable new count:3 address:0x1d97978L 494 first variable new count:4 address:0x1d97930L 495 first variable new count:4 address:0x1d97948L 496 second variable new count:4 address:0x1d97930L 497 first variable new count:5 address:0x1d97948L 498 first variable new count:4 address:0x1d97948L 499 first variable new count:4 address:0x1d97930L 500 second variable new count:4 address:0x1d97948L 501 first variable new count:5 address:0x1d97930L 502 first variable new count:4 address:0x1d97918L 503 second variable new count:4 address:0x1d97948L 504 first variable new count:5 address:0x1d97930L 505 first variable new count:5 address:0x1d97930L 506 first variable new count:5 address:0x1d97918L 507 second variable new count:5 address:0x1d97930L 508 first variable new count:6 address:0x1d97918L 509 first variable new count:3 address:0x1d97918L 510 first variable new count:3 address:0x1d97930L 511 second variable new count:3 address:0x1d97918L 512 first variable new count:4 address:0x1d97930L 513 first variable new count:3 address:0x1d97948L 514 second variable new count:3 address:0x1d97918L 515 first variable new count:4 address:0x1d97930L 516 first variable new count:4 address:0x1d97930L 517 first variable new count:4 address:0x1d97948L 518 second variable new count:4 address:0x1d97930L 519 first variable new count:5 address:0x1d97948L 520 first variable new count:3 address:0x1d97978L 521 second variable new count:3 address:0x1d97918L 522 first variable new count:4 address:0x1d97948L 523 first variable new count:4 address:0x1d97930L 524 second variable new count:4 address:0x1d97948L 525 first variable new count:5 address:0x1d97930L 526 first variable new count:4 address:0x1d97930L 527 first variable new count:4 address:0x1d97948L 528 second variable new count:4 address:0x1d97930L 529 first variable new count:5 address:0x1d97948L 530 first variable new count:4 address:0x1d97978L 531 second variable new count:4 address:0x1d97930L 532 first variable new count:5 address:0x1d97948L 533 first variable new count:5 address:0x1d97948L 534 first variable new count:5 address:0x1d97978L 535 second variable new count:5 address:0x1d97948L 536 first variable new count:6 address:0x1d97978L 537 first variable new count:3 address:0x1d97990L 538 second variable new count:3 address:0x1d97918L 539 first variable new count:4 address:0x1d97978L 540 first variable new count:4 address:0x1d97948L 541 second variable new count:4 address:0x1d97978L 542 first variable new count:5 address:0x1d97948L 543 first variable new count:4 address:0x1d97930L 544 second variable new count:4 address:0x1d97978L 545 first variable new count:5 address:0x1d97948L 546 first variable new count:5 address:0x1d97948L 547 first variable new count:5 address:0x1d97930L 548 second variable new count:5 address:0x1d97948L 549 first variable new count:6 address:0x1d97930L 550 first variable new count:4 address:0x1d97930L 551 first variable new count:4 address:0x1d97948L 552 second variable new count:4 address:0x1d97930L 553 first variable new count:5 address:0x1d97948L 554 first variable new count:4 address:0x1d97978L 555 second variable new count:4 address:0x1d97930L 556 first variable new count:5 address:0x1d97948L 557 first variable new count:5 address:0x1d97948L 558 first variable new count:5 address:0x1d97978L 559 second variable new count:5 address:0x1d97948L 560 first variable new count:6 address:0x1d97978L 561 first variable new count:4 address:0x1d97990L 562 second variable new count:4 address:0x1d97930L 563 first variable new count:5 address:0x1d97978L 564 first variable new count:5 address:0x1d97948L 565 second variable new count:5 address:0x1d97978L 566 first variable new count:6 address:0x1d97948L 567 first variable new count:5 address:0x1d97948L 568 first variable new count:5 address:0x1d97978L 569 second variable new count:5 address:0x1d97948L 570 first variable new count:6 address:0x1d97978L 571 first variable new count:5 address:0x1d97990L 572 second variable new count:5 address:0x1d97948L 573 first variable new count:6 address:0x1d97978L 574 first variable new count:6 address:0x1d97978L 575 first variable new count:6 address:0x1d97990L 576 second variable new count:6 address:0x1d97978L 577 first variable new count:7 address:0x1d97990L 578 first variable new count:2 address:0x1d97990L 579 first variable new count:2 address:0x1d97978L 580 second variable new count:2 address:0x1d97990L 581 first variable new count:3 address:0x1d97978L 582 first variable new count:2 address:0x1d97948L 583 second variable new count:2 address:0x1d97990L 584 first variable new count:3 address:0x1d97978L 585 first variable new count:3 address:0x1d97978L 586 first variable new count:3 address:0x1d97948L 587 second variable new count:3 address:0x1d97978L 588 first variable new count:4 address:0x1d97948L 589 first variable new count:2 address:0x1d97930L 590 second variable new count:2 address:0x1d97990L 591 first variable new count:3 address:0x1d97948L 592 first variable new count:3 address:0x1d97978L 593 second variable new count:3 address:0x1d97948L 594 first variable new count:4 address:0x1d97978L 595 first variable new count:3 address:0x1d97978L 596 first variable new count:3 address:0x1d97948L 597 second variable new count:3 address:0x1d97978L 598 first variable new count:4 address:0x1d97948L 599 first variable new count:3 address:0x1d97930L 600 second variable new count:3 address:0x1d97978L 601 first variable new count:4 address:0x1d97948L 602 first variable new count:4 address:0x1d97948L 603 first variable new count:4 address:0x1d97930L 604 second variable new count:4 address:0x1d97948L 605 first variable new count:5 address:0x1d97930L 606 first variable new count:2 address:0x1d97918L 607 second variable new count:2 address:0x1d97990L 608 first variable new count:3 address:0x1d97930L 609 first variable new count:3 address:0x1d97948L 610 second variable new count:3 address:0x1d97930L 611 first variable new count:4 address:0x1d97948L 612 first variable new count:3 address:0x1d97978L 613 second variable new count:3 address:0x1d97930L 614 first variable new count:4 address:0x1d97948L 615 first variable new count:4 address:0x1d97948L 616 first variable new count:4 address:0x1d97978L 617 second variable new count:4 address:0x1d97948L 618 first variable new count:5 address:0x1d97978L 619 first variable new count:3 address:0x1d97978L 620 first variable new count:3 address:0x1d97948L 621 second variable new count:3 address:0x1d97978L 622 first variable new count:4 address:0x1d97948L 623 first variable new count:3 address:0x1d97930L 624 second variable new count:3 address:0x1d97978L 625 first variable new count:4 address:0x1d97948L 626 first variable new count:4 address:0x1d97948L 627 first variable new count:4 address:0x1d97930L 628 second variable new count:4 address:0x1d97948L 629 first variable new count:5 address:0x1d97930L 630 first variable new count:3 address:0x1d97918L 631 second variable new count:3 address:0x1d97978L 632 first variable new count:4 address:0x1d97930L 633 first variable new count:4 address:0x1d97948L 634 second variable new count:4 address:0x1d97930L 635 first variable new count:5 address:0x1d97948L 636 first variable new count:4 address:0x1d97948L 637 first variable new count:4 address:0x1d97930L 638 second variable new count:4 address:0x1d97948L 639 first variable new count:5 address:0x1d97930L 640 first variable new count:4 address:0x1d97918L 641 second variable new count:4 address:0x1d97948L 642 first variable new count:5 address:0x1d97930L 643 first variable new count:5 address:0x1d97930L 644 first variable new count:5 address:0x1d97918L 645 second variable new count:5 address:0x1d97930L 646 first variable new count:6 address:0x1d97918L 647 first variable new count:2 address:0x1d97900L 648 second variable new count:2 address:0x1d97990L 649 first variable new count:3 address:0x1d97918L 650 first variable new count:3 address:0x1d97930L 651 second variable new count:3 address:0x1d97918L 652 first variable new count:4 address:0x1d97930L 653 first variable new count:3 address:0x1d97948L 654 second variable new count:3 address:0x1d97918L 655 first variable new count:4 address:0x1d97930L 656 first variable new count:4 address:0x1d97930L 657 first variable new count:4 address:0x1d97948L 658 second variable new count:4 address:0x1d97930L 659 first variable new count:5 address:0x1d97948L 660 first variable new count:3 address:0x1d97978L 661 second variable new count:3 address:0x1d97918L 662 first variable new count:4 address:0x1d97948L 663 first variable new count:4 address:0x1d97930L 664 second variable new count:4 address:0x1d97948L 665 first variable new count:5 address:0x1d97930L 666 first variable new count:4 address:0x1d97930L 667 first variable new count:4 address:0x1d97948L 668 second variable new count:4 address:0x1d97930L 669 first variable new count:5 address:0x1d97948L 670 first variable new count:4 address:0x1d97978L 671 second variable new count:4 address:0x1d97930L 672 first variable new count:5 address:0x1d97948L 673 first variable new count:5 address:0x1d97948L 674 first variable new count:5 address:0x1d97978L 675 second variable new count:5 address:0x1d97948L 676 first variable new count:6 address:0x1d97978L 677 first variable new count:3 address:0x1d97978L 678 first variable new count:3 address:0x1d97948L 679 second variable new count:3 address:0x1d97978L 680 first variable new count:4 address:0x1d97948L 681 first variable new count:3 address:0x1d97930L 682 second variable new count:3 address:0x1d97978L 683 first variable new count:4 address:0x1d97948L 684 first variable new count:4 address:0x1d97948L 685 first variable new count:4 address:0x1d97930L 686 second variable new count:4 address:0x1d97948L 687 first variable new count:5 address:0x1d97930L 688 first variable new count:3 address:0x1d97918L 689 second variable new count:3 address:0x1d97978L 690 first variable new count:4 address:0x1d97930L 691 first variable new count:4 address:0x1d97948L 692 second variable new count:4 address:0x1d97930L 693 first variable new count:5 address:0x1d97948L 694 first variable new count:4 address:0x1d97948L 695 first variable new count:4 address:0x1d97930L 696 second variable new count:4 address:0x1d97948L 697 first variable new count:5 address:0x1d97930L 698 first variable new count:4 address:0x1d97918L 699 second variable new count:4 address:0x1d97948L 700 first variable new count:5 address:0x1d97930L 701 first variable new count:5 address:0x1d97930L 702 first variable new count:5 address:0x1d97918L 703 second variable new count:5 address:0x1d97930L 704 first variable new count:6 address:0x1d97918L 705 first variable new count:3 address:0x1d97900L 706 second variable new count:3 address:0x1d97978L 707 first variable new count:4 address:0x1d97918L 708 first variable new count:4 address:0x1d97930L 709 second variable new count:4 address:0x1d97918L 710 first variable new count:5 address:0x1d97930L 711 first variable new count:4 address:0x1d97948L 712 second variable new count:4 address:0x1d97918L 713 first variable new count:5 address:0x1d97930L 714 first variable new count:5 address:0x1d97930L 715 first variable new count:5 address:0x1d97948L 716 second variable new count:5 address:0x1d97930L 717 first variable new count:6 address:0x1d97948L 718 first variable new count:4 address:0x1d97948L 719 first variable new count:4 address:0x1d97930L 720 second variable new count:4 address:0x1d97948L 721 first variable new count:5 address:0x1d97930L 722 first variable new count:4 address:0x1d97918L 723 second variable new count:4 address:0x1d97948L 724 first variable new count:5 address:0x1d97930L 725 first variable new count:5 address:0x1d97930L 726 first variable new count:5 address:0x1d97918L 727 second variable new count:5 address:0x1d97930L 728 first variable new count:6 address:0x1d97918L 729 first variable new count:4 address:0x1d97900L 730 second variable new count:4 address:0x1d97948L 731 first variable new count:5 address:0x1d97918L 732 first variable new count:5 address:0x1d97930L 733 second variable new count:5 address:0x1d97918L 734 first variable new count:6 address:0x1d97930L 735 first variable new count:5 address:0x1d97930L 736 first variable new count:5 address:0x1d97918L 737 second variable new count:5 address:0x1d97930L 738 first variable new count:6 address:0x1d97918L 739 first variable new count:5 address:0x1d97900L 740 second variable new count:5 address:0x1d97930L 741 first variable new count:6 address:0x1d97918L 742 first variable new count:6 address:0x1d97918L 743 first variable new count:6 address:0x1d97900L 744 second variable new count:6 address:0x1d97918L 745 first variable new count:7 address:0x1d97900L 746 first variable new count:2 address:0x1d978e8L 747 second variable new count:2 address:0x1d97990L 748 first variable new count:3 address:0x1d97900L 749 first variable new count:3 address:0x1d97918L 750 second variable new count:3 address:0x1d97900L 751 first variable new count:4 address:0x1d97918L 752 first variable new count:3 address:0x1d97930L 753 second variable new count:3 address:0x1d97900L 754 first variable new count:4 address:0x1d97918L 755 first variable new count:4 address:0x1d97918L 756 first variable new count:4 address:0x1d97930L 757 second variable new count:4 address:0x1d97918L 758 first variable new count:5 address:0x1d97930L 759 first variable new count:3 address:0x1d97948L 760 second variable new count:3 address:0x1d97900L 761 first variable new count:4 address:0x1d97930L 762 first variable new count:4 address:0x1d97918L 763 second variable new count:4 address:0x1d97930L 764 first variable new count:5 address:0x1d97918L 765 first variable new count:4 address:0x1d97918L 766 first variable new count:4 address:0x1d97930L 767 second variable new count:4 address:0x1d97918L 768 first variable new count:5 address:0x1d97930L 769 first variable new count:4 address:0x1d97948L 770 second variable new count:4 address:0x1d97918L 771 first variable new count:5 address:0x1d97930L 772 first variable new count:5 address:0x1d97930L 773 first variable new count:5 address:0x1d97948L 774 second variable new count:5 address:0x1d97930L 775 first variable new count:6 address:0x1d97948L 776 first variable new count:3 address:0x1d97978L 777 second variable new count:3 address:0x1d97900L 778 first variable new count:4 address:0x1d97948L 779 first variable new count:4 address:0x1d97930L 780 second variable new count:4 address:0x1d97948L 781 first variable new count:5 address:0x1d97930L 782 first variable new count:4 address:0x1d97918L 783 second variable new count:4 address:0x1d97948L 784 first variable new count:5 address:0x1d97930L 785 first variable new count:5 address:0x1d97930L 786 first variable new count:5 address:0x1d97918L 787 second variable new count:5 address:0x1d97930L 788 first variable new count:6 address:0x1d97918L 789 first variable new count:4 address:0x1d97918L 790 first variable new count:4 address:0x1d97930L 791 second variable new count:4 address:0x1d97918L 792 first variable new count:5 address:0x1d97930L 793 first variable new count:4 address:0x1d97948L 794 second variable new count:4 address:0x1d97918L 795 first variable new count:5 address:0x1d97930L 796 first variable new count:5 address:0x1d97930L 797 first variable new count:5 address:0x1d97948L 798 second variable new count:5 address:0x1d97930L 799 first variable new count:6 address:0x1d97948L 800 first variable new count:4 address:0x1d97978L 801 second variable new count:4 address:0x1d97918L 802 first variable new count:5 address:0x1d97948L 803 first variable new count:5 address:0x1d97930L 804 second variable new count:5 address:0x1d97948L 805 first variable new count:6 address:0x1d97930L 806 first variable new count:5 address:0x1d97930L 807 first variable new count:5 address:0x1d97948L 808 second variable new count:5 address:0x1d97930L 809 first variable new count:6 address:0x1d97948L 810 first variable new count:5 address:0x1d97978L 811 second variable new count:5 address:0x1d97930L 812 first variable new count:6 address:0x1d97948L 813 first variable new count:6 address:0x1d97948L 814 first variable new count:6 address:0x1d97978L 815 second variable new count:6 address:0x1d97948L 816 first variable new count:7 address:0x1d97978L 817 first variable new count:3 address:0x1d97978L 818 first variable new count:3 address:0x1d97948L 819 second variable new count:3 address:0x1d97978L 820 first variable new count:4 address:0x1d97948L 821 first variable new count:3 address:0x1d97930L 822 second variable new count:3 address:0x1d97978L 823 first variable new count:4 address:0x1d97948L 824 first variable new count:4 address:0x1d97948L 825 first variable new count:4 address:0x1d97930L 826 second variable new count:4 address:0x1d97948L 827 first variable new count:5 address:0x1d97930L 828 first variable new count:3 address:0x1d97918L 829 second variable new count:3 address:0x1d97978L 830 first variable new count:4 address:0x1d97930L 831 first variable new count:4 address:0x1d97948L 832 second variable new count:4 address:0x1d97930L 833 first variable new count:5 address:0x1d97948L 834 first variable new count:4 address:0x1d97948L 835 first variable new count:4 address:0x1d97930L 836 second variable new count:4 address:0x1d97948L 837 first variable new count:5 address:0x1d97930L 838 first variable new count:4 address:0x1d97918L 839 second variable new count:4 address:0x1d97948L 840 first variable new count:5 address:0x1d97930L 841 first variable new count:5 address:0x1d97930L 842 first variable new count:5 address:0x1d97918L 843 second variable new count:5 address:0x1d97930L 844 first variable new count:6 address:0x1d97918L 845 first variable new count:3 address:0x1d97900L 846 second variable new count:3 address:0x1d97978L 847 first variable new count:4 address:0x1d97918L 848 first variable new count:4 address:0x1d97930L 849 second variable new count:4 address:0x1d97918L 850 first variable new count:5 address:0x1d97930L 851 first variable new count:4 address:0x1d97948L 852 second variable new count:4 address:0x1d97918L 853 first variable new count:5 address:0x1d97930L 854 first variable new count:5 address:0x1d97930L 855 first variable new count:5 address:0x1d97948L 856 second variable new count:5 address:0x1d97930L 857 first variable new count:6 address:0x1d97948L 858 first variable new count:4 address:0x1d97948L 859 first variable new count:4 address:0x1d97930L 860 second variable new count:4 address:0x1d97948L 861 first variable new count:5 address:0x1d97930L 862 first variable new count:4 address:0x1d97918L 863 second variable new count:4 address:0x1d97948L 864 first variable new count:5 address:0x1d97930L 865 first variable new count:5 address:0x1d97930L 866 first variable new count:5 address:0x1d97918L 867 second variable new count:5 address:0x1d97930L 868 first variable new count:6 address:0x1d97918L 869 first variable new count:4 address:0x1d97900L 870 second variable new count:4 address:0x1d97948L 871 first variable new count:5 address:0x1d97918L 872 first variable new count:5 address:0x1d97930L 873 second variable new count:5 address:0x1d97918L 874 first variable new count:6 address:0x1d97930L 875 first variable new count:5 address:0x1d97930L 876 first variable new count:5 address:0x1d97918L 877 second variable new count:5 address:0x1d97930L 878 first variable new count:6 address:0x1d97918L 879 first variable new count:5 address:0x1d97900L 880 second variable new count:5 address:0x1d97930L 881 first variable new count:6 address:0x1d97918L 882 first variable new count:6 address:0x1d97918L 883 first variable new count:6 address:0x1d97900L 884 second variable new count:6 address:0x1d97918L 885 first variable new count:7 address:0x1d97900L 886 first variable new count:3 address:0x1d978e8L 887 second variable new count:3 address:0x1d97978L 888 first variable new count:4 address:0x1d97900L 889 first variable new count:4 address:0x1d97918L 890 second variable new count:4 address:0x1d97900L 891 first variable new count:5 address:0x1d97918L 892 first variable new count:4 address:0x1d97930L 893 second variable new count:4 address:0x1d97900L 894 first variable new count:5 address:0x1d97918L 895 first variable new count:5 address:0x1d97918L 896 first variable new count:5 address:0x1d97930L 897 second variable new count:5 address:0x1d97918L 898 first variable new count:6 address:0x1d97930L 899 first variable new count:4 address:0x1d97948L 900 second variable new count:4 address:0x1d97900L 901 first variable new count:5 address:0x1d97930L 902 first variable new count:5 address:0x1d97918L 903 second variable new count:5 address:0x1d97930L 904 first variable new count:6 address:0x1d97918L 905 first variable new count:5 address:0x1d97918L 906 first variable new count:5 address:0x1d97930L 907 second variable new count:5 address:0x1d97918L 908 first variable new count:6 address:0x1d97930L 909 first variable new count:5 address:0x1d97948L 910 second variable new count:5 address:0x1d97918L 911 first variable new count:6 address:0x1d97930L 912 first variable new count:6 address:0x1d97930L 913 first variable new count:6 address:0x1d97948L 914 second variable new count:6 address:0x1d97930L 915 first variable new count:7 address:0x1d97948L 916 first variable new count:4 address:0x1d97948L 917 first variable new count:4 address:0x1d97930L 918 second variable new count:4 address:0x1d97948L 919 first variable new count:5 address:0x1d97930L 920 first variable new count:4 address:0x1d97918L 921 second variable new count:4 address:0x1d97948L 922 first variable new count:5 address:0x1d97930L 923 first variable new count:5 address:0x1d97930L 924 first variable new count:5 address:0x1d97918L 925 second variable new count:5 address:0x1d97930L 926 first variable new count:6 address:0x1d97918L 927 first variable new count:4 address:0x1d97900L 928 second variable new count:4 address:0x1d97948L 929 first variable new count:5 address:0x1d97918L 930 first variable new count:5 address:0x1d97930L 931 second variable new count:5 address:0x1d97918L 932 first variable new count:6 address:0x1d97930L 933 first variable new count:5 address:0x1d97930L 934 first variable new count:5 address:0x1d97918L 935 second variable new count:5 address:0x1d97930L 936 first variable new count:6 address:0x1d97918L 937 first variable new count:5 address:0x1d97900L 938 second variable new count:5 address:0x1d97930L 939 first variable new count:6 address:0x1d97918L 940 first variable new count:6 address:0x1d97918L 941 first variable new count:6 address:0x1d97900L 942 second variable new count:6 address:0x1d97918L 943 first variable new count:7 address:0x1d97900L 944 first variable new count:4 address:0x1d978e8L 945 second variable new count:4 address:0x1d97948L 946 first variable new count:5 address:0x1d97900L 947 first variable new count:5 address:0x1d97918L 948 second variable new count:5 address:0x1d97900L 949 first variable new count:6 address:0x1d97918L 950 first variable new count:5 address:0x1d97930L 951 second variable new count:5 address:0x1d97900L 952 first variable new count:6 address:0x1d97918L 953 first variable new count:6 address:0x1d97918L 954 first variable new count:6 address:0x1d97930L 955 second variable new count:6 address:0x1d97918L 956 first variable new count:7 address:0x1d97930L 957 first variable new count:5 address:0x1d97930L 958 first variable new count:5 address:0x1d97918L 959 second variable new count:5 address:0x1d97930L 960 first variable new count:6 address:0x1d97918L 961 first variable new count:5 address:0x1d97900L 962 second variable new count:5 address:0x1d97930L 963 first variable new count:6 address:0x1d97918L 964 first variable new count:6 address:0x1d97918L 965 first variable new count:6 address:0x1d97900L 966 second variable new count:6 address:0x1d97918L 967 first variable new count:7 address:0x1d97900L 968 first variable new count:5 address:0x1d978e8L 969 second variable new count:5 address:0x1d97930L 970 first variable new count:6 address:0x1d97900L 971 first variable new count:6 address:0x1d97918L 972 second variable new count:6 address:0x1d97900L 973 first variable new count:7 address:0x1d97918L 974 first variable new count:6 address:0x1d97918L 975 first variable new count:6 address:0x1d97900L 976 second variable new count:6 address:0x1d97918L 977 first variable new count:7 address:0x1d97900L 978 first variable new count:6 address:0x1d978e8L 979 second variable new count:6 address:0x1d97918L 980 first variable new count:7 address:0x1d97900L 981 first variable new count:7 address:0x1d97900L 982 first variable new count:7 address:0x1d978e8L 983 second variable new count:7 address:0x1d97900L 984 first variable new count:8 address:0x1d978e8L 985 [9, 8, 7, 6, 5, 3, 2, 1]
从结果看,是对的,栈确实反转了,但是变量是常量个吗???
- 从代码的33行看,每次判断栈是否为空,如果不为空就弹出栈顶元素,然后进行递归调用,直到把栈弹空,每次递归调用随便变量名称都是“tmp”,但是每次是同一个变量么,难道只要变量名称不变,就是一个变量吗,内存地址每次调用都在变化吧,所以从满栈到空栈,我们用了多少次“tmp”这个变量呢?和栈的大小一样吧,而且这是一个变量,还有tmp2,我们没有计算。
- 我们知道这是递归调用的函数,函数内的变量是存放在栈空间的,然后linux和windows默认的栈空间其实并不大吧
默认就是这么大,linux你可以通过ulimit -a | grep stack 这个命令查看,如果这个要反转的栈大小为8M,那么可能就会出问题吧。
综上所述,我怀疑这个问题是个伪命题,反正至少我没想到空间复杂度O(1) 就能实现反转的办法,如果有大神有办法请指教或是请下面留言,多谢。
仅代表个人观点,如果内容有误,请留言指出,谢谢。
临表涕零,不知所言。
转载请注明——redbear博客
推荐系统技术&大厂面试题