摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes... 阅读全文
posted @ 2015-05-04 14:09 匡子语 阅读(180) 评论(0) 推荐(0)
摘要: Compare two version numbersversion1andversion2.Ifversion1>version2return 1, ifversion1 n2) return 1; if(n1 n2) return 1; else if(n1... 阅读全文
posted @ 2015-05-04 14:05 匡子语 阅读(220) 评论(0) 推荐(0)
摘要: Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 ->... 阅读全文
posted @ 2015-05-04 12:58 匡子语 阅读(247) 评论(0) 推荐(0)
摘要: Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will return the next... 阅读全文
posted @ 2015-05-04 12:19 匡子语 阅读(161) 评论(0) 推荐(0)