Graph DS

# We have seen the Google Map or any ordinary Papper Map, Right? 🙂

# What we can see there? Some Cities connected with Roads , Right? (Hence, many other things we can see also 😉)



# now let's Compare :)
  • # And think the roads as different lines, arcs or edges that connects two "Nodes" (two cities). || roads as Edges ||
  • # And think the roads as different lines, arcs or edges that connects two "Nodes" (two cities). || roads as Edges ||


# ====== Grpah Defination ========

# When you have multiple "Nodes" connected via edges that's called a Graph, look at the "Graph_DS_1.jpg" in this directory 😎



# ======== Directed Graph ========

# In some big cities, you might have seen one-way roads. That means you can go only one direction through those Roads. # And some roads have two direction also


# Similarly, if the lines or edges have any in a Graph, the that 'Graph' is called a 'Directed Graph'.




# ========= Existing Elements of a Graph DS ========

# Graph contains two things:

  1. Nodes
  2. Edges


# A 'Graph' has Nodes and Edges.


Example of Graph DS

# if you make multi-city travel plan, that's also a Graph Data Structure :)




Post a Comment

0 Comments