摘要: Maximum GapGiven an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/spac... 阅读全文
posted @ 2015-03-21 16:15 Eason Liu 阅读(1031) 评论(0) 推荐(0) 编辑
摘要: Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321click to show spoilers.Have you thought about this?Here are som... 阅读全文
posted @ 2015-03-21 13:54 Eason Liu 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Implement pow(x,n).注意n等于INT_MIN的时候,直接让n = -n会整形溢出.二分法: 1 class Solution { 2 public: 3 double pow(double x, int n) { 4 if (n == 0) return 1... 阅读全文
posted @ 2015-03-21 13:30 Eason Liu 阅读(142) 评论(0) 推荐(0) 编辑