Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. For example,Given nums = [0, 1, 3] return 2. Note:Your algorithm should run in linear runtime complexity. Could you implement it usi…
今天看到一位大神的博客,深受感触.决定也发一篇博客,证明一下我还活着. 于是我翻看以前学习时做的一些笔记,整理了一下,得到了一个关于异或运算交换变量变量值的笔记. 首先来看下面三组表达式,看起来他们都能实现交换两个变量的值. a = a ^ b; b = a ^ b; a = a ^ b; a = a ^ (b = b ^ (a = a ^ b)); a ^= b ^= a ^= b; 可实际的情况是,前面2组表达式,在C.C++.Java中都能顺利完成变量值的交换.而第3组表达式,却只在C.C…