Optimal Maximum distance traveled problem

Given max travel distance, forward and backwards routes, return the routes which utilizes maximum travel distance.
Example:
Forward route : [[1,3000],[2,5000],[3,4000],[4,10000],[5,8000]]
Backward route : [[1,1000],[2,3000],[3,4000]]
Max Distance Traveled: 11000

Check if path exists between two nodes in a graph using Breadth first search (BFS)

Here is the code:

class Program
    {
        static List<int> li = new List<int>();
        static void Main(string[] args)
        {         
            node r0 = new node(0);

Check if path exists between two nodes in a graph using Depth first search (DFS)

Here is the code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication75
{
    class Program
    {
        static List<int> li = new List<int>();
        static void Main(string[] args)
        {         
            node r0 = new node(0);

Breadth first search (BFS) Levels implementation in C#

Here is the code:

 class Program
    {
        static List<int> li = new List<int>();
        static void Main(string[] args)
        {         
            node r0 = new node(0);
            node r1 = new node(1);

Breadth first search (BFS) Graphs implementation in C#

Here is the code:
 class Program
    {
        static List<int> li = new List<int>();
        static void Main(string[] args)
        {         
            node r0 = new node(0);

Depth First Search (DFS) Graphs implmentation in C#

Here is the Code:

class Program
    {

        static List<int> li = new List<int>();
        static void Main(string[] args)
        {         
            node r0 = new node(0);

Popular Posts