[算法][LeetCode]Single Number——异或运算的巧妙运用
摘要:
题目要求Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?一个int数组中,除了有一个int只出现了一次,其他int都出现了两次,请找出这个int。要求:设计的算法是线性的复杂度,并且不要用额外的内存空间。解题思路异或运算的几个相关公式:1. a 阅读全文
posted @ 2013-10-30 17:12 南京大乱炖 阅读(1971) 评论(0) 推荐(1)
浙公网安备 33010602011771号