摘要:
题目地址:https://leetcode-cn.com/problems/complement-of-base-10-integer/ 解题思路:按位取反计算。注意不要想当然使用~,~10等于-11,而不是5。数据是以补码存储的,在计算机中,10的原码和补码为00...1010。取反后,补码变成1 阅读全文
摘要:
题目地址:https://leetcode-cn.com/problems/palindrome-linked-list/ 解题思路: 用一个数组装; class Solution { public: bool isPalindrome(ListNode* head) { ListNode *q; 阅读全文