摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- Remov 阅读全文
posted @ 2017-12-06 20:29 immjc 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... Note:n is positive and will fit within the range of a 32-bi 阅读全文
posted @ 2017-12-06 18:31 immjc 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 首先需要明确一个概念,就是*p++与(*p)++的区别。 *p++:对p取值,然后对p指针增加。 (*p)++:对p取值,然后对值增加。 ++a:表示取a的地址,对a的值进行增加,然后把这个值放入寄存器。结果可以作为左值。 实现代码如下: a++:表示取a的地址,把这个值放入寄存器,然后对内存中的a 阅读全文
posted @ 2017-12-06 10:41 immjc 阅读(209) 评论(0) 推荐(0) 编辑