Showing posts with label Recurssion. Show all posts
Showing posts with label Recurssion. Show all posts

Wednesday, 11 September 2013

Heap : A Data Structure for Efficient Programs


With exponential growth in computing capability of present day hardware as per Moore's law one can overlook the importance of efficient algorithms very easily. But efficient algorithm will always be critical as the complexity of programs running on today's efficient hardware has also increased with same pace if not more. 
Today people are dealing with huge social network graphs, or analysing twitter posts, or searching images, or solving any of the hundreds of problems in vogue. They would be wasting time without the fastest possible hardware. But if they use incorrect algorithms they would be sitting forever. Hence there is no substitute for an efficient algorithm.

Tuesday, 9 July 2013

Bowling Pin Arrangement Puzzle

Once you went to bowling with your friend. All the bowling pins were labelled with different integer from 0,1,2 .. to 9. The arrangement of pins (in a triangle form) was very interesting. If two pins are side-by-side, the sum of their labels (reduced modulo 10) is equal to the label of the pin in front and between them. For Example
1   2   4   5
  3   6   9
   9   5
   4


Friday, 5 July 2013

BFS, DFS and Connect Graph Algorithms

 

In mathematics, and more specifically in graph theory, a graph is a representation of a set of objects where some pairs of objects are connected by links. Graphs are incredibly important part of Modern day life. We come across them almost daily. For example we can reach our office via separate ways possible but which one to take(Considering distance, traffic). Whole of social media like Facebook, twitter, linkedin is nothing but a huge graph with people acting as node and their relationship(friendship) acting like links or edges. Computer networks, electricity distribution network, city pipeline network, road network, airline network, Internet are nothing but a form of a Graph. There are several types of Graphs such as Directed, Undirected, Tree, Weighted, Cyclic, Acyclic etc to name a few of them. And we find examples of almost all of them in real life.

Saturday, 11 May 2013

Mysteries and Beauty of Fractals


Its really amazing to know know how a simple equation zn+1 = zn2 + c can create patterns which are so intricate, so vivid and so beautiful. The set defined by above equation is know as Mandelbrot set and it represents a set of points denoted by c in a complex plane for which zn+1 remains always bounded starting with  z= 0. 

Tuesday, 30 April 2013

SystemC Hierarchy Scanner

During integration of a systemC virtual platform often it is desirable to traverse deep down the hierarchy  of systemC and find out type of each systemC components. More over we can also get the hande of exact types by trying out dynamic cast operation on to it. Presenting a sample class to show case the concept of hierarchy scanning. This can be further utilized to build complex utilities. For example using this I was able to build a text based systemC pin connector.