|
Java: Class File and Char Arrays |
|
Monday, 26 July 2010 20:06 |
|
Below are 'rough' notes regarding how Java class file contents differ for two character array initializations.
- The first variable is initialized from a string literal by calling 'toCharArray()'
- The second variable is initialized by using an array initializer.
|
|
Read more...
|
|
|
C: Longest Sequence Of Ones |
|
Monday, 26 July 2010 07:34 |
|
Below is the answer to "Find the longest sequence of bits set to one in an array?". Apparently some form of this question has been used by Microsoft during interviews.
The solution below is pretty basic, and can be improved in a few ways. For example:
- the 'inner loop' doing the bit shift may be avoided by comparing the current byte to 0x00 or 0xff
|
|
Read more...
|
|
C: Operator precedence Issue |
|
Thursday, 03 June 2010 07:25 |
|
I just came a across a fun/classic C operator precedence issue. I've never been a fan of the '++' and '--' operators for this exact reason. Below is an example you can play with yourself.
|
|
Read more...
|
|
|
Java: Print String Permutations |
|
Wednesday, 16 June 2010 08:26 |
|
Below is a simple solution printing all the permutations of a string. I wrote it in about 1 minute in order to test it out as an interview questions for co-op students. The solution can obviously be improved.
|
|
Read more...
|
|
C: Simple Function Pointer Example |
|
Friday, 14 May 2010 15:27 |
|
Below is a simple example of C function pointers.
|
|
Read more...
|
|
|
|
|
Start Prev 1 2 3 4 5 6 7 8 9 10 Next End
|
|
Page 1 of 20 |