Loading

摘要: 裁判测试程序样例: 解题思路: Q->Front指向首元素位置,Q->Count作为偏移量 阅读全文
posted @ 2018-10-20 22:12 拾月凄辰 阅读(717) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 public: 3 bool isPalindrome(ListNode* head) { 4 deque<int> d1, d2; 5 ListNode* p = head; 6 while (p != NULL) 7 { 8 d1.push_back(p 阅读全文
posted @ 2018-10-20 09:22 拾月凄辰 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x) : val(x), next(NULL) {} 7 * }; 阅读全文
posted @ 2018-10-20 09:18 拾月凄辰 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 给定一个只包括 '(',')','{','}','[',']' 的字符串,判断字符串是否有效。 有效字符串需满足: 左括号必须用相同类型的右括号闭合。 左括号必须以正确的顺序闭合。 注意空字符串可被认为是有效字符串。 示例 1: 输入: "()" 输出: true 示例 2: 输入: "()[]{} 阅读全文
posted @ 2018-10-20 09:16 拾月凄辰 阅读(161) 评论(0) 推荐(0) 编辑