Archive for November, 2009

22
Nov

Array sorting problem posted from hardwarezone

Saw this challenging question posted in the hardwarezone forum on sorting an array with one for loop without using array list.

The question is




This is a simple programming question...very simple and short question, but its really hard to solve..
Anyone who could do it, you are god of programming. 

 Given an array of random numbers let say..

 arrayX = {15, 20, 35, 45, 10, 40, 1, 3, 45};You are supposed to use ONLY ONE loop to swap the above into the following:
 arrayX = {15, 20, 3, 1, 10, 40, 45, 35, 45};

 NOTE: The purpose of your loop is to move all digits < 25 from the right hand side to the left side, and move all digits >= 25 to the right side. You can't sort the array but to use a single loop to scan the array from left and scan the array from right...and do the necessary swapping.

 You can try do it with C, C++...etc..
 Not easy as it seems to be!

Since the night is still young, I took some time to sit down and figure out the solution.

Continue reading ‘Array sorting problem posted from hardwarezone’

VN:F [1.9.7_1111]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.7_1111]
Rating: 0 (from 0 votes)
12
Nov

Unboxing Windows 7 Family Pack

Just received my Win 7 Family Pack from Amazon via VPost shipping.

Bought it at USD199 per pcs and SGD17+ for the shipping charges.

Im still backing up my files and will be installing Win7 over the weekend.

Here are the photos. Click on it to enlarge.

win7familyunbox00001

Hehe... Notice that it is USD1?

Continue reading ‘Unboxing Windows 7 Family Pack’

VN:F [1.9.7_1111]
Rating: 7.0/10 (1 vote cast)
VN:F [1.9.7_1111]
Rating: 0 (from 0 votes)
07
Nov

bangkok night view

Taken @ bangkok baiyoke sky hotel

f2.8, iso1600, 1/4sec

bangkok city night

VN:F [1.9.7_1111]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.7_1111]
Rating: 0 (from 0 votes)



Search Website

www.lingeriesg.com

www.lingeriesg.com

Sponsored Ads

Sponsored Links

www.asiadolly.com

www.asiadolly.com

About Me

Me

Hello, Im Benny Chong. This blog is a proof that I have too much spare time to burn. 

I will be writing topics mainly on web design, application development, photography and other rubbish. Cheers