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

Directed Acyclic Graph (DAG) | DAA

Directed Acyclic Graph (DAG)

DAG, here directed means that each edge has an arrow denoting that the edge can be traversed in only that particular direction. Acyclic means that the graph has no cycles, i.e., starting at one node, you can never end up at the same node. DAG can be used to find the shortest path from a given source node to all other nodes. To find the shortest path by using DAG, first of all sort the vertices of the graph topologically and then relax the vertices in topological order.



Example:

Directed Acyclie Graph (DAG) | DAA

Step 1: Sort the vertices of the graph topologically
Directed Acyclie Graph (DAG) | DAA

Step 2: Relax from S
Directed Acyclie Graph (DAG) | DAA

Step 3: Relax from C
Directed Acyclie Graph (DAG) | DAA

Step 4: Relax from A
Directed Acyclie Graph (DAG) | DAA

Step5: Relax from B
Directed Acyclie Graph (DAG) | DAA

Step6: Relax from D
Directed Acyclie Graph (DAG) | DAA


Algorithm

DagSP(G,w,s)
{
Topologically Sort the vertices of G
for each vertex v belongs to V
do d[v] = ?
d[s] = 0
for each vertex u, taken in topologically sorted order
do for each vertex v adjacent to u
do if d[v] > d[u] + w(u,v)
then d[v] = d[u] + w(u,v)
}

Analysis:

In the above algorithm, the topological sort can be done in O(V+E) time (Since this is similar to DPS! see a book.).The first for loop block lakes O(V) time. In the case of the second for loop, it executes in O(V2) Time so the total running time is O(V2). The aggregate analysis gives us the running time O(E+V).


Comments

Popular posts from this blog

Array in C Programming | C Programming

C program to Find Cartesian Product of Two Sets | C programming

What is System? | SAD