Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View zSANSANz's full-sized avatar

SecretCode zSANSANz

  • malang, east java, indonesia
View GitHub Profile
@zSANSANz
zSANSANz / minDistance.cpp
Created January 3, 2017 15:14
Greedy Algorithms | Set 7 (Dijkstra’s shortest path algorithm) on C++
// A C / C++ program for Dijkstra's single source shortest path algorithm.
// The program is for adjacency matrix representation of the graph
#include <stdio.h>
#include <limits.h>
// Number of vertices in the graph
#define V 9
// A utility function to find the vertex with minimum distance value, from
@zSANSANz
zSANSANz / Graph.cpp
Created January 3, 2017 15:12
Depth First Traversal for a Graph on C++
// C++ program to print DFS traversal from a given vertex in a given graph
#include<iostream>
#include<list>
using namespace std;
// Graph class represents a directed graph using adjacency list representation
class Graph
{
int V; // No. of vertices
@zSANSANz
zSANSANz / Graph.cpp
Created January 3, 2017 15:09
Breadth First Traversal for a Graph on C++
// Program to print BFS traversal from a given source vertex. BFS(int s)
// traverses vertices reachable from s.
#include<iostream>
#include <list>
using namespace std;
// This class represents a directed graph using adjacency list representation
class Graph
{
@zSANSANz
zSANSANz / Graph.cpp
Created January 3, 2017 15:08
Breadth First Traversal for a Graph on C++
// Program to print BFS traversal from a given source vertex. BFS(int s)
// traverses vertices reachable from s.
#include<iostream>
#include <list>
using namespace std;
// This class represents a directed graph using adjacency list representation
class Graph
{
@zSANSANz
zSANSANz / floydWarshall.cpp
Last active April 5, 2021 18:47
Floyd Warshall Algorithm on C++
// C Program for Floyd Warshall Algorithm
#include<stdio.h>
// Number of vertices in the graph
#define V 4
/* Define Infinite as a large enough value. This value will be used
for vertices not connected to each other */
#define INF 99999