摘要:
题目描述:Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive in... 阅读全文
posted @ 2015-06-23 09:32
Sawyer Ford
阅读(236)评论(0)推荐(0)
摘要:
题目描述:Divide two integers without using multiplication, division and mod operator.If it is overflow, return INT_MAX. 提示中谈到Binary Search,由此可想到解决方案。solu... 阅读全文
posted @ 2015-06-16 21:19
Sawyer Ford
阅读(169)评论(0)推荐(0)
摘要:
《Effective C++》在资源管理一节提到了智能指针,智能指针中最著名的当属auto_ptr和shared_ptr。本文主要研究两者的实现。auto_ptr的实现:template class auto_ptr{private: T *ptr;public: explicit ... 阅读全文
posted @ 2015-06-03 16:37
Sawyer Ford
阅读(356)评论(0)推荐(0)