Introduction
This is one of the simplest search techniques that involves a intuitive way of searching for an item in a sorted list. Yes the it requires to be sorted in some order that supports searching.For an example you may look for a certain page in a book. First you get…
Linked list is a data structure where nodes are kept in sequence as in a graph but in a linear manner.
As in the above graph what we all keep is a pointer/reference to the head of the…
In this post I’m going to talk how to detect if there is a cycle in a graph. Which means can there be more than one way of reaching any node from any other node in the graph. This is completely implemented using the DFS which I…
This is one of the most commonly used greedy algorithms in many fields. This algorithm tries to make a minimum cost Tree out of a given connected graph, otherwise no tree would exist but a Forest. Following are some applications of…
This algorithm runs in O(n³) time yet it gives shortest path between any two points. The algorithms simply looks the shortest path between two nodes passing a selected node. This operation takes place by using an adjacency matrix. Where the graph…
This is one of the most common algorithms that is used to get the shortest path from a single source point. This is useful since we can get the shortest distance to all the other points reachable from a single source point.
DFS is the complete other side of BFS. In DFS the search is carried out in a way by traveling to the depth starting from one node. Let’s consider the below example.
Implementation of BFS is very important in path finding algorithms. This is simply analogous to the motion of water waves once a stone is dropped at a point.