Data Structures

This category contains all the posts related to data structures. For e.g.: Hash Tables, Linked Lists, Trees, Graphs, Heaps, Tries etc..

Introduction to B Trees

This post is just an introduction to B Trees and here we will discuss one of the complicated data structures, B Trees. I would advice the reader to get familiar with the Tree data structures, and Balanced Trees. For e.g. : Binary Search Trees, AVL Trees, Red Black Trees and 2-3-4 Trees. If you are not familiar with any/few of the above mentioned data structures, then please do not worry, I will try to explain everything here from scratch and hopefully you might not need any external support. But in case you are trying to learn the above topics, please look into the Additional Read section a...
Read More

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

Graph Theory Applications – The Instant Insanity Puzzle

[nextpage title="Applications of Graph Theory"] Graph Theory is used in modelling and solving a lot of real world problems, games and puzzles. Here we discuss a very famous puzzle " The Instant Insanity " problem. The goal of this post is to demonstrate that such complicated problem statements can be so easily modeled and solved using Graph Theory. Also I would like to build some more  interest into Graph Theory. If you want to feel more comfortable with the basics of Graph Theory, here is a list of primers you might like to read once. Problem Definition - The Instant Insanity Puzzle The...
Read More

Priority Queues

Introduction You have N distinct jobs to process, and you are given the responsibility to schedule them on the only available job processor. New jobs keeps on getting added into the set of available jobs. Not all the jobs are to be executed as they come. There might be few which needs to be executed immediately and few can be postponed for some time. You have an efficiently algorithm to decide the priority of an incoming job. The task at hand is as follows: To schedule available jobs based on the priority assigned to them. Add new jobs to the set after assigning a priority to it. ...
Read More