Hexo

Home Archives
2018-04-29
Leetcode

XOR ^

XOR 异或

一般表示

$a⊕b$

In Python/ C++

a^b

运算性质

  1. 交换律 :$A ⊕ B = B ⊕ A$
  2. 结合律:$A ⊕ (B ⊕ C) = (A ⊕ B) ⊕ C$
  3. 恒等律:$A ⊕ 0 = A$
  4. 归零率:$A ⊕ A = 0$
  5. 推论:$(B ⊕ A) ⊕ B = A ⊕ (B ⊕ B) = A ⊕ 0 = A$
Share
  • Bit Manipulation
Newer
136. Single Number
Older

Categories

  • Hexo
  • Java
  • Leetcode
  • Python
  • Shell Command
  • Uncategorized
  • Web
    • Back-end
      • Django
    • Front-end
  • python

Tags

  • Bit Manipulation
  • Git
  • Set

Tag Cloud

Bit Manipulation Git Set

Archives

  • September 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018

Recent Posts

  • Leetcode 经验
  • Establish a django project
  • Set Max and Min in Python
  • Build a html page
  • HTML Basics
© 2018 John Doe
Powered by Hexo
Home Archives