摘要: 思路: 统计空格数,算出替换后串的大小,从最后一个开始往后移动,遇到空格,替换为"%20"。 (在串的最后面设置结束符'\0') 1 class Solution { 2 public: 3 void replaceSpace(char *str,int length) { 4 int len_st 阅读全文
posted @ 2020-04-21 21:49 刘小脑袋 阅读(95) 评论(0) 推荐(0)
摘要: 1. 使用栈 1 class Solution { 2 public: 3 vector<int> printListFromTailToHead(ListNode* head) { 4 vector<int> ArrayList; 5 stack<int> s; 6 ListNode* p=hea 阅读全文
posted @ 2020-04-21 20:24 刘小脑袋 阅读(106) 评论(0) 推荐(0)