Code Skiller logoCB Logo
Logo LearnLearnLogo PracticePracticeLogo HireHireLogo IDEIDE

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

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...

Read more

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...
Read more

Graph Representation

  1. 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...

Read more

Graph Traversals

Traversal is a process of visiting all the edges and vertices in a graph.

There are two main Traversal Algorithms:

  1. Breadth First Search [BFS]
  2. Depth First Search [DFS]

[Breadth First Search](https://codeskiller.codingblocks.com/library/arti...

Read more

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...

Read more

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:

  1. Shortest Path in unweighted graph.
  2. Shortest Path in weighted graph [Dijkstra’s]
  3. S...
Read more

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...

Read more

Library

WEB DEVELOPMENT

FAANG QUESTIONS