# Tagged: Expert

## Dijkstra’s – Shortest Path Algorithm (SPT) – Adjacency Matrix – Java Implementation

Earlier we have seen what Dijkstra’s algorithm is and how it works. In this article we will see its implementation using adjacency matrix. We strongly recommend reading – Dijkstra algorithm and how it works....

## Djkstra’s – Shortest Path Algorithm (SPT)

What is Dijkstra’s algorithm? Dijkstra algorithm is a greedy algorithm. It finds a shortest path tree for a weighted undirected graph. This means it finds a shortest paths between nodes in a graph, which may represent, for example, road networks For a given...

## Kruskal’s Algorithm – Minimum Spanning Tree (MST) – Complete Java Implementation

What is Kruskal Algorithm? Kruskal’s algorithm for finding the Minimum Spanning Tree(MST), which finds an edge of the least possible weight that connects any two trees in the forest It is a greedy algorithm. It...

## Prim’s – Minimum Spanning Tree (MST) |using Adjacency List and Priority Queue without decrease key in O(ElogV)

Earlier we have seen the implementation of prim’s algorithm using priority queue with decrease key and how decrease key has increased the time complexity. In this article we will improve the implementation(without decrease key)...

## Prim’s – Minimum Spanning Tree (MST) |using Adjacency List and Priority Queue with decrease key

Earlier we have seen what is Prim’s algorithm is and how it works. In this article we will see its implementation using adjacency list and Priority Queue. We strongly recommend to read – prim’s...

## Prim’s – Minimum Spanning Tree (MST) |using Adjacency List and Min Heap

Earlier we have seen what is Prim’s algorithm is and how it works. In this article we will see its implementation using adjacency list and Min Heap. We strongly recommend to read – prim’s...

## Prim’s – Minimum Spanning Tree (MST) |using Adjacency Matrix

Earlier we have seen what is Prim’s algorithm is and how it works. In this article we will see its implementation using adjacency matrix. We strongly recommend to read – prim’s algorithm and how...

## Prim’s Algorithm – Minimum Spanning Tree (MST)

What is Prim’s algorithm? Prim’s algorithm is a greedy algorithm. It finds a minimum spanning tree for a weighted undirected graph. This means it finds a subset of the edges that forms a tree that includes every vertex, where the total weight of all...

## Graph – Find Cycle in Undirected Graph using Disjoint Set (Union-Find)

Objective: Given a graph, check if the graph contains a cycle using disjoint set. Note: Disjoint-set data structure, also called a union–find data structure or merge–find set. Example: Earlier in Detect Cycle in Undirected Graph using DFS we...

## Disjoint Set | Union-Find Algorithm – Union by rank and path compression

Earlier we have seen the complete implementation of Disjoint Set. We strongly recommend reading this before continue. Disjoint Set operations – MakeSet(x) Find(x) Union(x,y) Click here to read about these operations in detail. How...

## Disjoint Set Data Structure – Union Find Algorithm

What is Disjoint-set data structure? Represents a mathematics concept Set. A disjoint-set data structure, also called a union–find data structure or merge–find set. A disjoint-set data structure that keeps track of a set of elements partitioned into a number of disjoint or non-overlapping subsets. It...

## Graph – Detect Cycle in a Directed Graph using colors

Objective: Given a directed graph write an algorithm to find out whether graph contains cycle or not. Example: Approach: Graph contains cycle if there are any back edges. There are two types of back...