2014年12月21日
摘要: class Solution {public: typedef ListNode * SNode; ListNode *rotateRight(ListNode *head, int k) { SNode pcurrent , pnext,ptemp; if(knext == NULL) ... 阅读全文
posted @ 2014-12-21 15:42 xgcode 阅读(112) 评论(0) 推荐(0)
摘要: 题目提示采用贪心算法,不知道别人怎么实现的,可以参考下别人的思路。答案如下:class Solution {public: vector leftgas; int len; int canCompleteCircuit(vector &gas, vector &cost) { l... 阅读全文
posted @ 2014-12-21 11:19 xgcode 阅读(146) 评论(0) 推荐(0)
摘要: 该题答案如下:class Solution {public: string addBinary(string a, string b) { string::reverse_iterator itea,iteb; string result; char temp; ... 阅读全文
posted @ 2014-12-21 10:24 xgcode 阅读(92) 评论(0) 推荐(0)