Saturday, 10 May 2014

Sorting Algorithm Folk Dances


Are you one of those souls who are always confused by different Sorting Algorithms and the subtle differences among them?  Then breathe easy. Here is the most amusing way to learn few of them. When I saw these videos on youtube, I was totally mesmerized by it and I could not resist sharing it here. 
Hats off to the choreographers and the dancers for their such rhythmic and logical steps portaying the loop and the swapping moves of sorting algorithms. You may find visual simulations/animations of these sort algorithms but nothing like these folk dances.
My favourite among them is the MergSort and Quick Sort Dance. Sharing the video  links below. Enjoy and learn..

Friday, 7 March 2014

Working with C/C++ Static and Dynamic Libraries


In today’s world the applications we need to build can easily run into of thousands of lines of code. Applications with such big complexity can never be built monolithically as that will be a maintenance nightmare, prone to tight coupling and will require huge build time. Hence breaking huge applications into smaller logical modules is need of the day.
We need to break a big application into several modules, compile them separately and then link them together. This brings in the two linking techniques namely Static Linking and Dynamic Linking.

Friday, 28 February 2014

Decoding a DP Problem

Dynamic Programming aka DP is a design technique in computer science, mathematics and bioinformatics to solve complex problem by breaking it into sub problems. It is one of the most powerful methods to solve optimization problem exhibiting exponential run-time complexity (via brute force) in polynomial time at cost of some extra memory space.

This technique was first invented by Richard Bellman and he gave it the name “Dynamic Programming” as he did not want to reveal his work while he was working on it. There is nothing dynamic in a DP technique; it simply called so because its inventor coined this name for it. However the word ‘Programming’ is due to the fact that it is like a tabular method to solve a problem similar to linear programming.

Tuesday, 28 January 2014

My Stint with SystemC Processes


SystemC process are fundamental construct in systemC to model concurrency. There are three types of process namely SC_METHOD, SC_THREAD, SC_CTHREAD but the ones that I have actively used are the first two. There is lot of documentation/example available about SC_THREAD and SC_METHODS in systemC LRM and on the web, hence I am not going into explaining what is a Thread or a Method but rather I want to focus on the issues/challenges I came across when I first started to use them to solve real world modelling problem.

Friday, 8 November 2013

Circular Dependency: An Anti-Pattern and Techniques to avoid it in object oriented Design

When I attempted to write my first object oriented program with some meaningful complexity I was hit by the problem of cyclic/circular dependency. As the name suggests the problem definition is very simple. If we need to design two classes which need to call functions of each other directly how do we accomplish that? And what are the issues we may land up into if we do not pay proper attention to avoid circular dependency among them. I am sure this problem would have come up with many other programmers like me. In this post I would like to get in depth of this problem and explain why its call an anti-pattern and what are possible approaches to avoid it.