Top 10 Programming Language to learn in 2023

Are you a programming enthusiast looking to stay ahead of the curve in 2023? With the ever-evolving tech landscape, keeping up with the Best Programming Language to learn can be a daunting task. Fear not, as we have compiled a list of the top 10 Programming Languages that you should consider learning in 2023. Python: This versatile language continues to dominate in 2023, with its ease of use, readability, and a vast library of modules. JavaScript: As web development grows increasingly popular, JavaScript remains a crucial player, with its ability to create dynamic and interactive web pages. Java: This language has stood the test of time and remains a popular choice for enterprise software development. C++: A staple in the gaming and systems development industries, C++ offers exceptional performance and memory management. Swift: Apple's preferred language for iOS app development, Swift continues to grow in popularity with its simplicity and reliability. R: As data science and machin...

C Program To Implement Dijkstra's Algorithm For Finding Shortest Path | C Programming

C Program To Implement Dijkstra's Algorithm For Finding Shortest Path | C Programming

#include "stdio.h"

#include "conio.h"

#define infinity 999

void dij(int n, int v, int cost[10][10], int dist[])

{

    int i, u, count, w, flag[10], min;

    for (i = 1; i <= n; i++)

        flag[i] = 0, dist[i] = cost[v][i];

    count = 2;

    while (count <= n)

    {

        min = 99;

        for (w = 1; w <= n; w++)

            if (dist[w] < min && !flag[w])

                min = dist[w], u = w;

        flag[u] = 1;

        count++;

        for (w = 1; w <= n; w++)

            if ((dist[u] + cost[u][w] < dist[w]) && !flag[w])

                dist[w] = dist[u] + cost[u][w];
    }
}

int main()

{

    int n, v, i, j, cost[10][10], dist[10];

    printf("Enter the number of nodes:");

    scanf("%d", &n);

    printf("\n Enter the cost matrix:\n");

    for (i = 1; i <= n; i++)

        for (j = 1; j <= n; j++)

        {

            scanf("%d", &cost[i][j]);

            if (cost[i][j] == 0)

                cost[i][j] = infinity;
        }

    printf("\n Enter the source matrix:");

    scanf("%d", &v);

    dij(n, v, cost, dist);

    printf("\n Shortest path:n");

    for (i = 1; i <= n; i++)

        if (i != v)

            printf("%d->%d,cost=%dn", v, i, dist[i]);

    return 0;
}

Comments

Popular posts from this blog

Eliminating Epsilon transition (ε-Transitions) | Conversion of Epsilon-NFA to DFA | Conversion of Epsilon-NFA to NFA | Theory Of Computation (TOC)

Doolittle Algorithm: LU Decomposition Algorithm

Top 10 Programming Language to learn in 2023