Friday, May 02, 2008

Find number in array

There is an array consisting of 2n+1 unsigned integers. n numbers in the array are "married", i.e they occur twice in the array. However there is one number only appears once in the array. Find that number in a single pass using constant memory.

Eg : 3 5 3 4 1 5 1 7 2 2 4
Ans: 7

33 Comments:

Blogger TomasBlaser said...

thanks................................................

2:53 AM  
Blogger 惠佩政萍 said...

cool blog,期待更新........................................

5:00 AM  
Blogger 怡萱 said...

很喜歡你的blog哦...加油唷 ........................................

4:17 PM  
Blogger 辰原 said...

thx u very much, i learn a lot

7:25 PM  
Blogger FrederickI_婷妏Ferreri1003堅強 said...

感謝分享好的作品~~.........................

7:43 PM  
Blogger 麗威麗威 said...

may the blessing be always with you!! ...............................

8:04 PM  
Blogger 韋于倫成 said...

每一個人無論怎樣渺小,在自己的眼中,都自有其份量..............................

4:15 PM  
Blogger 文佩齊華 said...

Beauty, unaccompanied by virtue, is as a flower without perfume...................................................

8:26 AM  
Blogger 廖淑凡 said...

Well done!............................................................

8:27 PM  
Blogger 趙佳治 said...

人生的價值以及他的快樂,都在於他有能力看重自己的生存........................................

4:40 AM  
Blogger 冠慧 said...

失去金錢的人,失去很多;失去朋友的人,失去更多;失去信心的人,失去所有。..................................................................

10:54 PM  
Blogger 姜志銘 said...

期待你每一篇文章......................................................................

7:20 PM  
Blogger 江婷 said...

在莫非定律中有項笨蛋定律:「一個組織中的笨蛋,恆大於等於三分之二。」......................................................................

1:22 AM  
Blogger 育財育財 said...

成熟,就是有能力適應生活中的模糊。.................................................................

7:31 PM  
Blogger 珮陽 said...

向著星球長驅直進的人,反比踟躕在峽路上的人,更容易達到目的。............................................................

12:15 AM  
Blogger 育隆 said...

閱讀您的BLOG文章,真是件快樂的事!..................................................................

10:20 AM  
Blogger 姿柯瑩柯dgdd憶曾g智曾 said...

時間可證明一切~你的BLOG是我覺得不賴的..................................................................

10:13 AM  
Blogger  said...

Pen and ink is wits plough. ............................................................

5:51 PM  
Blogger 趙筱婷terrifields汪華昕 said...

All roads lead to Rome. 堅持自己所選!..................................................................

2:25 AM  
Blogger 蔡靜芳蔡靜芳 said...

Gods mill grinds slow but sure...................................................

5:47 PM  
Blogger 莊雅和莊雅和莊雅和 said...

要持續更新下去喲!!期待~~..................................................................

12:41 AM  
Blogger 琬安琬安 said...

哈哈,忍不住一篇一篇翻出來看耶!!!............................................................

7:03 PM  
Blogger 謝謝孟凱惠敏 said...

人不可以求其備,必捨其所短,取其所長............................................................

4:14 PM  
Blogger 吳家達張怡萱張怡萱 said...

「仁慈」二個字,就能讓冬天三個月都溫暖。..................................................

6:13 PM  
Blogger 駱李淑華明欣 said...

It is easier to get than to keep it.......................................................................

8:53 PM  
Blogger 怡于名君 said...

愛,拆開來是心和受兩個字。用心去接受對方的一切,用心去愛對方的所有。......................................................................

7:10 PM  
Blogger 沈許玉佳貞儀 said...

人類的聰明,並非以經驗為依歸,而是以接受經驗的行程為依歸。..................................................

7:07 AM  
Blogger 偉曹琬 said...

愛情是盲目的,但婚姻恢復了它的視力。..................................................................

11:52 PM  
Blogger 怡張樺怡張樺怡張樺 said...

永遠支持你呀!!HO!!HO!!HO!!HO!!~~............................................................

12:47 PM  
Blogger 阿袁袁袁袁華 said...

每次看完你的文章,總是回味許久,要經常發表喔。..................................................

5:58 PM  
Blogger 王辛江淑萍康 said...

人有兩眼一舌,是為了觀察倍於說話的緣故。............................................................

8:51 PM  
Blogger 怡靜怡靜怡靜怡雯 said...

用行動來支持你~~~不留言不行!............................................................

2:18 AM  
Blogger 冠州 said...

加油!!! 很棒的分享~

5:59 PM  

Post a Comment

<< Home