Farewell to seniors..

It was that time of the year when the final year students start expecting a farewell from their juniors. I'm glad we didn't disappoint them :P.. We had to postpone it twice! Many of us had given up hopes of having one actually, but it happened on may 18th :)

Johnson Trotter Algorithm!

Johnson trotter algorithm gives a non recursive approach to generate permutations. The algorithm goes something like this..


while there exists a mobile integer k do
-->find the largest mobile integer k;
-->swap k and the adjacent integer its arrow points to;
-->reverse the direction of all integers that are larger than k

I'm using a character flag to maintain the direction of the mobile integers.. the code is simple, suggestions to make it more simple are always welcome :)

Sudoku Solver!

I wanted to write a sudoku solver from a very long time. I had over estimated the problem; rather the solution, to a very great extent. It was sattvik who helped me to come out of that feeling. His words, 'simple validation and backtracking will do the job' made me think for sometime and i got the solution. I was really happy once i completed writing the code. started at 1 in the noon. At 5:30, i had something which could be compiled, but it didn't work as usual :P. debugged it till 8:30 to get the code working. :-)

First Post..

Hello everyone.. I was using the site www.krishbharadwaj.com from quite sometime. It was template driven and i couldn't do much with it.. Just to edit the contents, I had to login to a website which was very slow and opened only in IE.. I was facing a lot of problems. Then i discovered the content management system Drupal..( www.drupal.org ) Its very easy to use and provides a wide set of modules for adding more and more features.. I'll try to write regularly on this blog. Keep watching this space :)