Hamiltonian Circuit – Seating Arrangement Problem

Here is a problem statement "Twenty members of a club meet each evening for dinner at a round table. They plan to sit such that every member has different neighbors every evening. Find out the number of days for which this arrangement can last." Here is another one "There is a list of 20 cities with roads connecting them, a salesman wants to sell his goods by visiting each city exactly once. Is that possible for a given network of cities?" Many a times we have been given problems like above and it is not really easy to solve them if we are not equipped with the Graph Theory. What ...
Read More

Euler Graphs – Origin of Graph Theory

This should have been my first post in the Graph Theory series but nevertheless I got time to discuss this now. Every one must have heard the famous problem of Seven Bridges of Königsberg. If not, then please take some time to read about the problem either on the Wikipedia or right down below: The city of Konigsberb is located on both the banks of the river Pregel(Kaliningrad, Russia - former Prussia).  The city also included two big islands and these islands were connected to each other and the main land by the means of seven bridges. Something like below: The problem is to devise a...
Read More

Details of Class Loading in JVM

Have you ever seen a ClassNotFoundException or a NoClassDefFoundError? Did you ever face a situation where you are trying to cast and assign it to a compatible reference but it throws a ClassCastException ? Or did you face issues where you never understood where to put the jars in your application? Ever did any hot deployment on a running Application Server and wondered how the new changes get reflected without a server restart? Ever got confused with the process of Class Loading in JVM? If you didn't face any of these, then you are extremely lucky or you are yet to start development :)...
Read More

Java Virtual Machine Startup

In the last post we had a brief idea about the memory model of the Java Virtual Machine. We also came across certain terms like the Creation, Linking, Loading and Initialization of classes. In this post we will try to improve our understanding of all these terms. At the Java Virtual Machine Startup The JVM starts up by creating an initial class and loads it using the bootstrap class loader (we will learn about the class loader in another post). Some implementation of the JVM allow us to pass the name of the initial class using the command line. The JVM then links this initial class. L...
Read More

Memory Model of Java Virtual Machine

The Java Virtual Machine is an abstract computing machine. It is responsible for most of the features which made Java a great technology. Few of the major selling points of Java was: Platform Independence Hardware Independence Operating System Independence Security from malicious programs It is said to be abstract computing machine because it offers all the specification which if implemented properly can act as a machine to execute instructions. Sun Microsystems (now acquired by Oracle) offers an implementation of the JVM. The JVM understands a particular binary format wh...
Read More

The Pitfalls of Singleton Design Pattern

Yes! its true that a Singleton object is the loneliest construct in Programming. :) Let us keep the humor aside and listen to this interesting story. Last time we had a fun story while understanding the Factory Method Design Pattern. This time let us have a story from one of our software developers  Manish. He wants to create this wonderful application. An awesome application This application uses the socket connections heavily and has to write data over the network. Manish wrote a code which works great. Every time he wants to use the connection he creates one and starts using it. In no ...
Read More

Abstract Factory Pattern

Extending our story of Jay the Carpenter, O! you missed the beginning ? Check my previous post. Last we heard from Jay, he was selling furniture happily and was able to define a strict process for franchises to follow and he also gave them freedom to make furniture as they like. He basically controlled the post making process, where the customers would get a well painted, polished and packed furniture. Of course the franchises were not very happy as they were not able to churn out more money after this was outlined. They thought of doing other nasty things. They figured out their own ...
Read More