Sorting binary array - Array containing only 0 and 1 in one pass OR two color sort
in your Pseudocode, the if condition should be if …
RM - May 3, 2014
in your Pseudocode, the if condition should be if (low < high).
Thanks Rish. I have made the change a[low] > a[high] rather than low < low. :). Thanks for correcting me.
Sorting binary array - Array containing only 0 and 1 in one pass OR two color sort
Data Structures Interview Questions (Theoritical)
To reverse the bits in an integer
Check if the 20th bit of a 32 bit integer is on or off?
AND it with x00001000 and check if its equal to x00001000
if((num & x00001000)==x00001000)
Note that the digits represented here are in hex.
`
0 0 0 0 1 0 0 0
^
|
x0000 0000 0000 0000 0001 0000 0000 0000 = 32 bits
^ ^ ^
| | |
0th bit 20th bit 32nd bit
`
CTS Aptitude Question paper(Yellow)
I actually enjoyed reading through this posting.Ma…
Felcy - Sep 3, 2011
I actually enjoyed reading through this posting.Many thanks.