Tuesday, 3 September 2013

Use Indent to indent your C-code

I myself not very much expert in writing indented code and code without indentation looks just horrible. Of course you will not have same feelings if you are using an IDE with auto indentation facility and of course if you know how to write indented code. For this purpose I found Indent command very useful in linux. One thing you should remember that this command is only for C code.
Actually not me, one of my friend Arjun Pakrashi informed me about this command.

Iterative Quick sort

I am not going to state basic Quick sort algorithm or its implementation. We all know about these stuffs. Today I am going to focus on Iterative Quick sort implementation in C. We know that Quick sort is recursive in nature. So we need a stack data structure. For that purpose we may use recursive function or use an external stack data structure to simulate recursive functions.  Throughout the post I am going to use the leftmost element as the pivot element and we are only concerned about array implementation.