GRAPHS
GRAPHS
The most popular data structures in companies like Direct-i, Google, and Arcesium etc. It is usually considered tough because of the dependency on other data strucutres such as queue, hashmaps, sets, and heap etc. but once you get a taste of how to apply these things together it will make you a better programmer.
Introduction to Graphs
Introduction to Graphs
What is Graph?
A graph is a non-linear data structure that represents a collection of interconnected nodes or vertices. It consists of a set of vertices and a set of edges, where each edge connects a pair of vertices.
Example: Consider two loca...
Glossary of Graphs
Glossary of Graphs
Types of Graphs:
The graphs can be divided into two categories namely Weighted and Unweighted Graph:
- Weighted Graph: A graph data structure called a "weighted graph" has weights assigned to each edge. Any other metric pertinent to the rela...
Graph Representation
Graph Representation
- Adjacency Matrix:
An adjacency matrix is a way to represent a graph using a two-dimensional matrix.
In an adjacency matrix, the rows and columns of the matrix represent the vertices of the graph. If there are n vertices in the graph, the adj...
Graph Traversals
Graph Traversals
Traversal is a process of visiting all the edges and vertices in a graph.
There are two main Traversal Algorithms:
- Breadth First Search [BFS]
- Depth First Search [DFS]
[Breadth First Search](https://codeskiller.codingblocks.com/library/arti...
Topological Sorting
Topological Sorting
Topological sorting arranges the nodes of a directed acyclic graph (DAG) in a linear order. In this linear order, if there is a directed edge from node A to node B, then A will always appear before B. This ordering is known as a topological order.
T...
Shortest Path Algorithms
Shortest Path Algorithms
Shortest path algorithms are used to find the shortest path between two vertices in a graph.
Shortest Path Algorithms for several types of Graphs such as:
- Shortest Path in unweighted graph.
- Shortest Path in weighted graph [Dijkstra’s]
- S...
Spanning Tree
Spanning Tree
Minimal Spanning Tree
A minimal spanning tree (MST) is a subset of the edges of a weighted, connected graph that connects all the vertices with the minimum possible total edge weight. It is a fundamental concept in graph theory and finds applica...
Library
WEB DEVELOPMENT
FAANG QUESTIONS